BookmarkSubscribeRSS Feed
tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10

Eclipse2024.png

 

In advance of Monday's solar eclipse, a SAS ODS Graphics map of the locations in Architectural Digest's Where to See the Solar Eclipse: The 13 Best Cities to Watch the Event. Happy viewing, all!

 

*  Fun With SAS ODS Graphics: Mr. Sun, Mr. Moon (Best Cities for Eclipse Viewing)
   Data source: Gecoded cities from architecturaldigest.com/story/solar-eclipse-2024-best-cities;
                                                                 * Get cities + latitude + longitude from Google Sheets;   
FILENAME cities url 'https://docs.google.com/spreadsheets/d/1uu9zHLpaKteksCFKnvQw-HWS7czdW1nY8IzGPpq-TSQ/export?format=csv&gid=0';
proc import datafile=cities out=cities DBMS=CSV REPLACE; GETNAMES=Yes; DATAROW=2;

ods graphics / antialias height=7in width=7in;
proc sgmap plotdata=cities noautolegend;                         * Use SGMAP + OpenStreetMap to plot cities; 
title height=14pt font=arial "Architectural Digest's 13 Best Cities for Seeing the Solar Eclipse";
openstreetmap;                                                   * Overlay multiple markers in attempt at black-on-yellow 'eclipse-look' markers;
scatter x=long y=lat / datalabel=city datalabelattrs=(family=arial size=14pt color=black) markerattrs=(symbol=circlefilled size=13pt);
scatter x=long y=lat / markerattrs=(symbol=circlefilled size=12pt color=yellow); * Stadium points;
scatter x=long y=lat / markerattrs=(symbol=circlefilled size=8pt color=black); * Stadium points;
run;

  

DATA (Google Sheets)

EclipseData.png

5 REPLIES 5
tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10
That is a pretty epic blog post! Beyond the eclipse, that last code snippet looks like it could help families and friends solve the what's-the-closest-restaurant-to-all-of-us problem! 😊
GraphGuy
Meteorite | Level 14

Yep - interesting blog post. ... But it doesn't appear they used SAS to create any of the maps in the blog post(?)

LeliaM
SAS Employee

They used the SGMAP procedure, which is shipped with Base SAS. SAS Help Center: Overview: PROC SGMAP

GraphGuy
Meteorite | Level 14

The maps in the blog post show numeric (lat/long) axes - I've never seen Proc SGMAP do that. Are you 100% certain they were created with SGMAP?

 

harenburg-solar-eclipse-april-figure-3.png

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 533 views
  • 7 likes
  • 4 in conversation