%let name=dive_nc; filename odsout '.'; /* Data mainly from ... http://www.nc-wreckdiving.com/WRECKS/ Also consulted... http://www.scubadivers.ws/sites.htm http://www.ncangler.com/forums/f4/wrightsville-beach-area-52.html http://www.teamlivewire.com/NorthCarolinaGPS.htm http://www.scubaboard.com/archive/index.php/t-38577.html The motherload of gps locations! http://www.ncdmf.net/download/ReefGuide2005.pdf */ /* Use unprojected maps.county, rather than maps.uscounty, so you can annotate stuff, and re-project it. */ data my_map; set maps.county (where=(fipstate(state) in ('NC' 'SC'))); run; proc sql; /* get 1 obsn for each state/county pair */ create table my_mapdata as select unique state, county from my_map; /* get the county names */ create table my_mapdata as select my_mapdata.*, cntyname.countynm from my_mapdata left join maps.cntyname on my_mapdata.state=cntyname.state and my_mapdata.county=cntyname.county; quit; run; /* Add html title= chart tips with the county name */ data my_mapdata; set my_mapdata; length htmlvar $1024; htmlvar= 'title='||quote( trim(left(countynm))||' county, '||trim(left(fipstate(state))) ); run; data dive_data; length site $ 50; length type $ 30; length depth $ 20; length link $ 200; infile datalines dlm=','; input site type latdegrees latminutes longdegrees longminutes depth; latitude=latdegrees+(latminutes/60); longitude=longdegrees+(longminutes/60); link='http://www.nc-wreckdiving.com/WRECKS/'||trim(left(upcase(site)))||'/'||trim(left(upcase(site)))||'.HTML'; if site eq 'Markham/Hyde' then link='http://www.wilmingtondiving.com/markham.shtml'; else if site eq 'Gill' then link='http://www.wilmingtondiving.com/jdgill.shtml'; else if site eq 'Cassimir' then link='http://www.wilmingtondiving.com/cassimer.shtml'; else if site eq 'Esso_Nashville' then link='http://www.wilmingtondiving.com/nashville.shtml'; else if site eq 'Normania' then link='http://www.wilmingtondiving.com/normannia.shtml'; else if site eq 'Pocahontas/Stone/Playa' then link='http://www.wilmingtondiving.com/pocahontas.shtml'; else if site eq 'Suloide' then link='http://www.discoverydiving.com/wreck_desc.htm#Suloide'; else if site eq 'FryingPan' then link='http://www.wilmingtondiving.com/fryingpantower.shtml'; else if site eq 'Queen_Annes_Revenge' then link='http://www.ah.dcr.state.nc.us/QAR/'; datalines; Abrams ,Tanker,34,57.458,75,47.920,80-90Ft Ashkhabad ,Tanker,34,21.000,76,20.000,55Ft Atlas ,Tanker,34,31.689,76,14.501,80-125Ft Australia ,Tanker,35,7.377,75,21.176,90-110Ft Cassimir ,Tanker,33,57.938,77,1.829,90-115Ft Caribsea ,Freighter,34,36.414,76,18.846,70-90Ft Dixie ,Tanker,34,54.011,75,44.972,70-90Ft Fareast ,Tanker,34,32.349,76,0.833,135-160Ft Fenwick ,Trawler,34,36.238,76,29.499,50-65Ft Indra ,Wreck,34,33.730,76,51.104,45-65Ft Keshena ,Tug,34,59.610,75,45.718,75-90Ft Lobster ,Dredge,33,51.280,76,57.860,115-125Ft Manuela ,Freighter,34,40.615,75,47.135,140-160Ft Naeco ,Tanker,34,1.520,76,38.878,125-145Ft Normannia ,Freighter,33,51.552,77,9.373,90-110Ft Papoose ,Tanker,34,8.670,76,39.120,90-120Ft Proteus ,Passenger,34,45.918,75,47.010,110-120Ft Schurz ,Gunboat,34,11.218,76,36.127,95-110Ft Tarpon ,Submarine,34,45.195,75,46.025,130-140Ft U352 ,Submarine,34,13.655,76,33.913,115Ft Markham/Hyde,Dredge,33,57.5,77,33.3,60-85Ft Gill ,Large,33,52.35,77,29.01,75-95Ft Esso_Nashville,Steam_Tanker,33,51.80,77,12.00,80-110Ft Normania ,Freighter,33,51.55,77,9.37,110-115Ft Pocahontas/Stone/Playa ,Tug,33,58.6,77,40.90,55-65Ft Houston ,Passenger/Freighter,33,24.5,77,42.7,78-98Ft Aeolus ,Cable_Repair,34,16.672,76,38.661,65-130Ft Suloide ,Freighter,34,32.706,76,53.700,65Ft Hutton ,Tanker,34,29.937,76,53.863,70Ft Ramsey ,Liberty_ship,34,10.5,77,45.1,50Ft Parker ,Liberty_ship,34,40.35,76,44.72,25-50Ft Yancey ,Amphibious_Cargo_Ship,34,10.27,76,13.70,120-160Ft Dionysus ,Liberty_ship,35,44,75,26.73,65Ft ZaneGray ,Liberty_ship,35,43,75,26.77,65Ft FryingPan ,Tower,33,29,77,35.5,45Ft Queen_Annes_Revenge ,Wreck,34,40,76,40,20ft ; run; data dive_data; set dive_data; x=atan(1)/45 * longitude; y=atan(1)/45 * latitude; run; /* Create an annotate dataset, containing pie/circle for each location */ data circle_anno; length function style color $ 8 position $ 1 text $ 20 html $1024; retain xsys ysys '2' hsys '3' when 'a'; set dive_data; /* convert the decimal degrees into degrees & minutes */ anno_flag=1; /* Create a link & chart-tip for the circle & label - since I have lots of info I want to show, I hardcode some '0d'x characters (carriage returns) to break the info onto several lines ... these multi-line charttips can only be viewed with Internet Explorer (netscape can only view 1 line). */ html= 'title='||quote( 'Name: '||trim(left(site))||'0d'x|| 'Type: '||trim(left(type))||'0d'x|| 'Depth: '||trim(left(depth))||'0d'x|| 'Longitude: '||trim(left(put(abs(longitude),comma5.1)))||'0d'x|| 'Latitude: '||trim(left(put(latitude,comma5.1)))|| ' ')|| ' '|| 'href="'||trim(left(link))||'"'; /* 'href="http://www.nc-wreckdiving.com/WRECKS/'||trim(left(upcase(site)))||'/'||trim(left(upcase(site)))||'.HTML"'; */ function='pie'; color='red'; style='psolid'; position='5'; rotate=360; size=.35; output; run; /* Annotate the longitude/latitude grid lines */ %let min_long=-75.00; %let max_long=-78.50; %let min_lat=33.25; %let max_lat=36.25; data grid_anno; length function style color $ 8; retain xsys ysys '2' hsys '3' when 'b'; anno_flag=1; do long = &min_long to &max_long by -.25; function='label'; color='black'; longitude=long; latitude=&min_lat; /* convert the decimal degrees into degrees & minutes */ degrees=abs(int(long)); minutes=abs((long-int(long))*60); text=trim(left(degrees))||'B0'x||trim(left(put(minutes,z2.)))||"'"; position='a'; size=2; angle=90; output; color='gray'; size=.1; line=33; /* dashed line */ function='move'; longitude=long; latitude=&min_lat; output; do lat = &min_lat to &max_lat by .25; function='draw'; longitude=long; latitude=lat; output; end; end; do lat = &min_lat to &max_lat by .25; function='label'; color='black'; longitude=&min_long; latitude=lat; degrees=abs(int(lat)); minutes=abs((lat-int(lat))*60); text=trim(left(degrees))||'B0'x||trim(left(put(minutes,z2.)))||"'"; position='c'; size=2; angle=0; output; color='gray'; size=.1; line=33; /* dashed line */ function='move'; latitude=lat; longitude=&min_long; output; do long = &min_long to &max_long by -.25; function='draw'; latitude=lat; longitude=long; output; end; end; run; data grid_anno; set grid_anno; x=atan(1)/45 * -1*longitude; y=atan(1)/45 * latitude; run; data all_anno; set circle_anno grid_anno; run; /* project the map */ data combined; set my_map all_anno; run; proc gproject data=combined out=combined dupok /* do map-clipping, as described in Mike Zdeb's book "Maps Made Simple", p. 59 */ longmax=79 longmin=74 latmax=37 latmin=32 ; id state county; run; data my_map all_anno; set combined; if anno_flag=1 then output all_anno; else output my_map; run; /* Annotate a picture of the dive-flag onto the left-hand side of the map ... */ data img; length function text $ 8; length color $ 8; xsys='3'; ysys='3'; hsys='3'; when='A'; html='title="Dive Sites" href="http://www.nc-wreckdiving.com/" '; function='move'; x=2; y=40; output; function='image'; x=x+18; y=y+20; imgpath='diveflag.gif'; style='fit'; output; run; GOPTIONS DEVICE=gif; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="SCUBA Diving Sites") style=minimal gtitle gfootnote ; goptions gunit=pct htitle=7 htext=4 ftitle="arial" ftext="arial" ctitle='black' ctext='black' ; title link="http://www.nc-wreckdiving.com" c=red 'North Carolina Wreck Diving'; title2 c=gray 'Mouse over markers to see detailed data.'; title3 c=gray "Click on markers to go to that wreck's web site."; title4 a=-90 h=5pct " "; footnote h=10pct c=white " "; pattern1 c=burlywood v=s r=5; goptions border cback=white; proc gmap map=my_map data=my_mapdata anno=all_anno; id state county; choro state / coutline=gray nolegend discrete html=htmlvar anno=img des="" name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;