BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AncaTilea
Pyrite | Level 9

Hi,

Is it possible to create US and world maps using GTL and SGRENDER?

I know PROC GMAP creates nice maps, I was curious if there is a SG version for GMAP.

Thank you.

Anca.

1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

I assume this is more of a question about processing the map polygons, and determining which counties border other counties, so you can then determine the correlations (using non-graphical techniques), before you then plot the data on a map(?)

Here's some code that might help - given a county, it can determine the other counties with adjacent borders. You could then apply such code to every county, to determine the adjacent counties to each of them (which would be quite a bit of work, and data management).

Counties bordering Cary, NC (SAS/Graph gmap)

http://robslink.com/SAS/democd26/adjacent_info.htm

View solution in original post

5 REPLIES 5
Jay54
Meteorite | Level 14

There is no SG procedure for maps.  However, depending on your needs, and the version of SAS you are using, you can create simple maps using SGPLOT or GTL and map data sets.

With SAS 9.2, you can create outline maps as shown in this article.

SAS 9.4M1 release includes the new POLYGON plot statement.  This statement plots any arbitrary polygon, including map regions.  You can overlay any other compatible plot statement on it as long as you can merge the data correctly into one data set. I posted one article on Polygon Plot earlier describing its features which can be customized to draw maps.  Here's one example.  If this is of interest to you, I can provide more information.

USA_Map_Skin.png

AncaTilea
Pyrite | Level 9

Thank you, Sanjay.

I use SAS 9.3. You have provided useful information.

My other question is re:counties level US map. I can (easily) create a US map at the county level, however, I need to create a 'smooth' county level US map.

In other words, I need to create a map that will account for the correlation between the bordering counties.

I know there is modelling involved in creating the correlations associated with the counties and what not, but before I dig into that, I thought I'd ask if there is some option in PROC GMAP to turn ON the 'smooth'ness.

Thank you, Sanjay!

Jay54
Meteorite | Level 14

I will let other experts (Robert?) address this GMAP question.

GraphGuy
Meteorite | Level 14

I assume this is more of a question about processing the map polygons, and determining which counties border other counties, so you can then determine the correlations (using non-graphical techniques), before you then plot the data on a map(?)

Here's some code that might help - given a county, it can determine the other counties with adjacent borders. You could then apply such code to every county, to determine the adjacent counties to each of them (which would be quite a bit of work, and data management).

Counties bordering Cary, NC (SAS/Graph gmap)

http://robslink.com/SAS/democd26/adjacent_info.htm

AncaTilea
Pyrite | Level 9

You are correct.

I wanted to check there is not an easier way to account for the correlation, and the links you sent are very helpful.

Thank you.

Anca.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1701 views
  • 4 likes
  • 3 in conversation