Hello ,
attached are two datasets, first one(Baltimore city) contains longitude and latitude for a city in Baltimore, and in second one are few data points with location information which i need to place on map and color by tower Cell.
I am able to do it in R but not in SAS.
Thank you.
Many of us will not download Excel files as they are security threats. The best way to provide data is via SAS data step code (and not in any other format). Instructions
But also, show us what you have tried. Have you looked at the PROC SGMAP documentation?
As others have suggested, start with the doc. Here is an example that overlays points and lines on a map:
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grmapref/n0x9p71lic5q5an15063k0qjo8er.htm
You should also look at the dozens of examples in the SAS blogs. For example, Google quickly located this one:
As PaigeMiller mentioned, it would be interesting to see what you've tried.
That being said, here is one solution ...
proc import datafile="/home/u59782200/datapoints.xlsx" out=datapoints dbms=xlsx;
run;
proc import datafile="/home/u59782200/balt_city.xlsx" out=balt_city dbms=xlsx;
run;
proc sgmap mapdata=balt_city plotdata=datapoints;
openstreetmap;
choromap / mapid=subregion lineattrs=(color=red thickness=2px);
scatter x=long y=lat / group=tower
markerattrs=(symbol=circlefilled size=12px)
/* More current versions let you specify colors via colormodel=(cxd7191c yellow) */
;
run;
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!
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.