BookmarkSubscribeRSS Feed
RandoDando
Pyrite | Level 9

I am wondering how to add an external shapefile overtop a US county map in SAS using GMAP (SGMAP not in my license).  The county choro map I have uses state and county as the IDs, county as the choro variable.  The external shapefile does not have state and county fields, the only corresponding fields are X, Y.  I've used GREMOVE and annotate to add layers in the past, but each time those additional layers already had the same matching ID variables (e.g. state, county) I was using in GMAP.  All I need is an example, and I can go from there.  A google search has yielded nothing helpful. Thanks

3 REPLIES 3
RandoDando
Pyrite | Level 9
OK. I got it to work, BUT I have a slight issue. I imported the shapefile, added lat and Long using the X Y variables, combined it with the map data, projected the combined set, and then split the files back to the Map and anno sets. However, the resulting map is now tilted to the right. Is there any way to remove the tilted earth effect?
RandoDando
Pyrite | Level 9

Solved.  Adding in LONGMAX= (to max long value of the map data) to the GPROJECT statement fixed this. 

GraphGuy
Meteorite | Level 14

I think this example should provide some good tips, similar to what you're wanting to do.

In particular, I recommend using the new(ish) Proc Gproject parmout and parmin parameters, so you can project the map and shapefile/annotate separately (this will probably help you avoid that 'tilt' you mentioned).

 

http://robslink.com/SAS/democd97/hurricane_evacuation.htm

https://robslink.com/SAS/democd97/hurricane_evacuation.sas

 

In this example, the yellow underlying map is a county map, and the colored evacuation zones are annotated (created from a shapefile).

 

hurricane_evacuation5.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
  • 3 replies
  • 485 views
  • 0 likes
  • 2 in conversation