BookmarkSubscribeRSS Feed
sascode
Quartz | Level 8

 Hi,

I have a dataset for some facility ID level, part of a given Ny state as below:
table have:

 id    Longitude     Latitude         Measure   Cat           Count_Fips_Code

 

1        -85.52972    33.10083    0.6           low               1

2         -87.165        31.57167   0.8           high              1

3        -85.4075       33.65056   0.5           medium        2

.....................................................

I need to map now these facilities and coloring it by category to see if any relation exists between cat and location. I was able to generate one map using proc gmap but the problem is

i had to aggregate measure based on Fips code( had to calculate avrg of measure for each Fips code previously) .

Any suggestion how to create this map in facility id level without aggregating step?

Thank you. 

 

2 REPLIES 2
ballardw
Super User

If you want to display markers at a specific point with different appearance such as color, shape or size of the marker then you are likely looking at an annotate approach. Create an annotate data set with the correct coordinates to match your map data and provide the marker appearance options desired.

 

One example is at https://support.sas.com/kb/24/906.html that provides different marker appearances for specific cities on a map.

Or https://robslink.com/SAS/Home.htm has 100's of example graphs with working code. Look at the mapping topics. Each page has a dozen or so pictures of maps. Find one that sort of resembles what you expect and follow the link(s) to the source code and data used for the shown map.

GraphGuy
Meteorite | Level 14

Here's one way to plot the facilities on a map, color-coded by 'cat'...

 

data foo;
length cat $10;
input id Longitude Latitude Measure Cat Count_Fips_Code;
datalines;
1        -85.52972    33.10083    0.6           low               1
3        -85.4075       33.65056   0.5           medium        2
2         -87.165        31.57167   0.8           high              1
;
run;

proc sgmap plotdata=foo;
openstreetmap;
scatter x=longitude y=latitude / group=cat 
 markerattrs=(symbol=circlefilled size=12px) 
 /* More current versions let you specify colors via colormodel=(cxd7191c yellow) */
 ;
run;

facilities_map.png

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 359 views
  • 1 like
  • 3 in conversation