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!
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;
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;
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.
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.
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.
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 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.