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

Hi folks,

 

I have tried searching for the answer to this question online but haven't been able to find it so I thought I'd ask here. I have a CBSA-level map that I need to annotate two things onto: state borders, and star markings for two of the CBSAs. I can easily create two separate maps, one with the CBSAs and state lines, and one with the CBSAs and star markings (using two separate PROC GMAP statements). However, I can't figure out how to annotate both the state lines and the star markings onto the same map. I tried using two ANNO= statements, but that didn't work. I also tried listing both datasets in the same ANNO= statement, but that didn't work either. I finally tried concatenating the two annotate datasets so they was only one annotate dataset, and then it mapped neither the stars nor the state lines. I guess I'm wondering if there's a way to simply annotate two different datasets onto the same map.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Proc gmap will support two or more annotate data sets. One on the proc statement that would apply to all maps and then a separate annotate used in each specific map section such as choro.

 

Another approach is to append multiple conceptual annotate sets into a single set. Order becomes important at that point as the later items appear over the earlier. I use this approach to provide regional boundaries other than county within state boundaries with different line weights and/or colors and then point data with the order being region border, stateborder, point data (markers)

 

Some example pseudo code

 

proc gmap map=maps.us data = mydata annotate=boundaryanno;

id county;

choro myanalysisvariable/ anno = pointanno;

View solution in original post

5 REPLIES 5
ballardw
Super User

Proc gmap will support two or more annotate data sets. One on the proc statement that would apply to all maps and then a separate annotate used in each specific map section such as choro.

 

Another approach is to append multiple conceptual annotate sets into a single set. Order becomes important at that point as the later items appear over the earlier. I use this approach to provide regional boundaries other than county within state boundaries with different line weights and/or colors and then point data with the order being region border, stateborder, point data (markers)

 

Some example pseudo code

 

proc gmap map=maps.us data = mydata annotate=boundaryanno;

id county;

choro myanalysisvariable/ anno = pointanno;

Darrell_sas
SAS Employee

Also, it should be possible to combine the 2 annotate data sets.  Did you use GPROJECT and was it on both annotate data sets?

Try putting your point data set first, also.  In case you don't end your boundry map correctly.

 

osi814
Obsidian | Level 7

Thank you for your reply. I used GPROJECT on the boundary dataset, but not on the point dataset. I just tried combining the two datasets again with the points first, and this time it mapped the state line boundaries but no points.

osi814
Obsidian | Level 7

ballardw, Thank you for your reply. I tried taking your first suggestion with putting the boundaries in the PROC statement and the points in the CHORO statement, and that resulted in the state lines but no points. I also tried your second suggestion of combining the datasets; I tried both with the state lines first then the points and the points first then the state lines, but both combinations resulted in only the state lines being mapped now. If I annotate the points alone, they definitely show up on the map - I don't know why it seems impossible to get them on with the state lines there too.

osi814
Obsidian | Level 7

As an update, all of these solutions actually worked. I was doing something wrong on my end with the putting in the wrong dataset name of all things..thanks to both of you for your help!!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1277 views
  • 0 likes
  • 3 in conversation