%let name=pipelines; filename odsout '.'; /* From this page: http://www.eia.gov/maps/layer_info-m.php Downloaded the "Petroleum Product Pipelines" shapefile: http://www.eia.gov/maps/map_data/PetroleumProduct_Pipelines_US_EIA.zip */ %let color1=red; %let color2=cx9999ff; %let color3=cx00ff00; proc mapimport datafile='D:\Public\EIA\Pipelines\PetroleumProduct_Pipelines_US_201606.shp' out=pipelines; run; data pipelines; set pipelines; lat=y; long=x; anno_flag=1; original_order=_n_; if opername='COLONIALPIPELINE CO' then on_top=1; else on_top=0; run; proc sort data=pipelines out=pipelines; by on_top original_order; run; data break; lat=33.2715931; long=-86.8966908; anno_flag=2; run; data us_map; set mapsgfk.us_states (where=(density<=3 and statecode not in ('AK' 'HI')) drop=resolution); run; data combined; set us_map pipelines break; run; proc gproject data=combined out=combined latlong eastlong degrees dupok; id statecode; run; data pipelines break us_map; set combined; if anno_flag=1 then output pipelines; else if anno_flag=2 then output break; else output us_map; run; data anno_points; set pipelines; xsys='2'; ysys='2'; hsys='3'; when='a'; length function $8 color $12; if opername='COLONIALPIPELINE CO' then color="&color1"; else color="&color2"; function='pie'; size=0.25; rotate=360; style='pempty'; length html $300; html= 'title='||quote( trim(left(pipename))||'0d'x|| trim(left(opername))); output; run; data anno_lines; set pipelines; by shape_leng notsorted; xsys='2'; ysys='2'; hsys='3'; when='a'; size=.1; length function $8 color $12; if opername='COLONIALPIPELINE CO' then color="&color1"; else color="&color2"; if first.shape_leng then function='move'; else function='draw'; output; run; data anno_break; set break; xsys='2'; ysys='2'; hsys='3'; when='a'; length function $8 color $12; function='pie'; style='pempty'; rotate=360; color="&color3"; size=1.4; output; size=1.5; output; run; data all_anno; set anno_break anno_lines anno_points; run; goptions device=png; goptions xpixels=850 ypixels=600; goptions border; ODS LISTING CLOSE; ODS html path=odsout body="&name..htm" (title="Petroleum Product Pipelines") style=htmlblue; goptions gunit=pct ftitle='albany amt' ftext='albany amt' htitle=4.5 htext=2.5; goptions ctext=gray33; pattern1 v=s c=white; title1 ls=2.5 move=(+25,+0) "Petroleum Product Pipelines"; title2 ls=1.0 move=(+25,+0) c=&color1 "red line = Colonial Pipeline Company"; title3 ls=1.0 move=(+25,+0) c=&color3 "green circle = Pipeline Break"; proc gmap data=us_map map=us_map all anno=all_anno; id statecode; note move=(6,4) link="http://www.eia.gov/maps/map_data/PetroleumProduct_Pipelines_US_EIA.zip" c=gray "Data source: eia.gov 2016"; choro segment / levels=1 nolegend coutline=graydd cdefault=white des='' name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;