%let name=scottish_festivals_nc; filename odsout '.'; /* Scottish festivals in (or near) North Carolina */ %let red=cxac2b41; %let ltblue=cx9bd5f6; %let ltgreen=cxb1fccd; %let dkgrn=cx4a9638; /* Prepare the blank map */ data my_map; set mapsgfk.us_counties (where=(statecode in ('NC' 'SC' 'VA') and density<=2) drop=resolution); run; proc gproject data=my_map out=my_map latlong eastlong degrees dupok parmout=work.projparm; id state county; run; /* Set up your data */ data my_data; infile datalines pad truncover; input name $ 1-80; input state $ 1-2 city $ 4-80; input typical_date $ 1-80; input description $ 1-300; input foo $ 1-80; datalines; Grandfather Mountain Highland Games NC Linville July - Second Weekend Largest Highland Games in South. Five invited pipe bands combine for opening and closing ceremonies, Parade of Tartans. Solo piping and drumming contests. Pipe Quartet contest. --------- Triad Highland Games NC Greensboro May - First Saturday Massed pipe bands and individual band concerts throughout day. Began in Archdale. --------- Bethabara Park Celtic Festival and Scottish Games NC Winston-Salem May -Third Saturday Pipe band informal concerts throughout day. Historic demonstrations on grounds of early Moravian settlement. --------- Scotland County Highland Games NC Laurinburg October - First Week-end Solo piping and drumming and pipe band competitions. Heavy athletics. --------- Western North Carolina Celtic Festival NC Asheville June - Second Saturday On grounds of Asheville Brewery. Live entertainment all day from popular Celtic bands. --------- Cary Indoor Highland Competition NC Cary March Indoor Piping & Dancing competition --------- Taste of Scotland NC Franklin June - Third Saturday Parade, vendors, Scottish foods. Entertainment by invited pipe bands. --------- Celtic Festival at Historic Latta Plantation NC Huntersville March - Third Saturday Features historic battle re-enactments --------- Cape Fear Highland Games NC Wilmington March - Fourth Saturday Heavy athletics --------- Loch Norman Highland Games NC Huntersville April - Third Week-end Solo piping and drumming and pipe band competitions. Massed bands for opening and closing ceremonies on Saturday and Sunday. --------- Carolina Caledonian Fest NC Fayetteville October Athletics & entertainment (looks a bit different from most festivals) --------- Gallabrae Highland Games SC Greenville May (Memorial Day weekend) Piping, Heavy athletics, etc --------- Charleston Scottish Games SC Mount Pleasant September Heavy athletic, piping, etc. --------- Tartan Day South SC Columbia March Highland Games and Celtic Festival --------- Virginia Scottish Games VA The Plains September (Labor Day weekend) Piping, Heavy athletics, etc --------- Saltwater Highland Games SC Myrtle Beach March Heavy athletics, with pipers performing --------- Central Virginia Celtic Festival & Highland Games VA Richmond October Heavy athletics, piping & drumming, etc --------- Radford Highlanders Festival VA Radford October Games & musical entertainment (free admission!) --------- Smoky Mountain Scottish Festival & Games TN Maryville May Athletics, Pipes & drums, etc --------- Stone Mountain Highland Games GA Stone Mountain October Athletics, Dance, Band, and Solo competitions --------- Tartan Day NC NC Raleigh Around April 6 @ NC Museum of History Bagpipes, highland dancing, demonstrations, discussions, clan information, etc --------- ; run; /* Find the lat/long coordinate of each city */ proc geocode data=my_data out=my_data (rename=(x=long y=lat)) method=CITY lookupcity=sashelp.zipcode; run; /* Project the city lat/longs the same way you did the map */ /* (projected coordinates will be in Y/X variables) */ proc gproject data=my_data (where=(lat^=.)) out=my_data latlong eastlong degrees dupok parmin=work.projparm parmentry=my_map; id; run; data anno_markers; set my_data; run; /* Sort the data, so you can use 'by', so you can add offsets if other than the first marker in the same city */ proc sort data=anno_markers out=anno_markers; by state city; run; /* Create the annotated marker with HTML mouse-over text */ data anno_markers; set anno_markers; retain x_offset; by state city; if first.city then x_offset=0; else x_offset+1; x=x+(.0015*x_offset); length function $8 color $12; xsys='2'; ysys='2'; hsys='3'; when='a'; function='pie'; size=2.0; rotate=360; color='blue'; style='psolid'; color='Affff00aa'; output; length html $500; html='title='||quote( trim(left(name))||'0d'x|| trim(left(city))||', '||trim(left(state))||'0d'x|| 'Typical date: '||trim(left(typical_date))||'0d'x|| '------------------------------'||'0d'x|| trim(left(description)))|| ' target="scot1"'|| ' href='||quote('http://www.google.com/search?&q='||trim(left(name))||' in '||trim(left(city))); style='pempty'; color="&red"; output; run; goptions device=png; goptions xpixels=800 ypixels=800; goptions border; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Scottish Festivals & Highland Games") style=htmlblue; goptions ftitle="albany amt/bold" ftext="albany amt" htitle=16pt htext=12pt; goptions ctext=&red; goptions cback=<blue; pattern1 v=s c=<green; /* NC */ pattern2 v=s c=cxd6f9e3; /* SC */ pattern3 v=s c=cxd6f9e3; /* VA */ data anno_titles; length text $100 html $300; xsys='3'; ysys='3'; hsys='d'; when='a'; function='label'; position='5'; style='albany amt/bold'; size=31; x=28; y=93; text='Scottish Festivals'; output; y=y-7; text='Highland Games'; output; style='albany amt'; size=20; y=y-7; text='and such...'; output; style='albany amt'; size=12; color='gray77'; x=75; y=6; text='Hover mouse over markers to see details.'; output; y=y-3; text='Click markers to launch Google search.'; output; x=16; text='Updated 2017'; output; run; title; footnote; proc gmap data=my_map map=my_map all anno=anno_titles; id state county; choro statecode / discrete nolegend coutline=&dkgrn anno=anno_markers des='' name="&name"; run; /* set up the html for the drilldown links in the table */ data my_data; set my_data; length link $300 href $300; label link='Event'; href='href='|| quote('http://www.google.com/search?&q='||trim(left(name))||' in '||trim(left(city))); link = '' || htmlencode(trim(name)) || ''; run; proc sort data=my_data out=my_data; by name; run; ods html anchor='table'; title1 h=14pt c=&red "Scottish Festivals, Highland Games, and such..."; title2 h=14pt c=&red "In and around North Carolina"; proc print data=my_data noobs label style(data)={font_size=12pt} style(header)={font_size=12pt} ; label city='City' state='State' typical_date='When'; var link city state typical_date; run; quit; ODS HTML CLOSE; ODS LISTING;