Data visualization with SAS programming

Is it possible to have two annotate datasets?

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

Is it possible to have two annotate datasets?

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!


Accepted Solutions
Solution
‎01-08-2016 01:36 PM
Super User
Posts: 11,134

Re: Is it possible to have two annotate datasets?

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


All Replies
Solution
‎01-08-2016 01:36 PM
Super User
Posts: 11,134

Re: Is it possible to have two annotate datasets?

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;

SAS Employee
Posts: 170

Re: Is it possible to have two annotate datasets?

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.

 

Contributor
Posts: 20

Re: Is it possible to have two annotate datasets?

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.

Contributor
Posts: 20

Re: Is it possible to have two annotate datasets?

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.

Contributor
Posts: 20

Re: Is it possible to have two annotate datasets?

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!!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 435 views
  • 0 likes
  • 3 in conversation