12-14-2017 12:26 PM - edited 12-14-2017 12:30 PM
Hello Graph enthusiasts!
I thought you'd like to know about this new feature in Base SAS (introduced in 9.4 Maint 5) -- you can now create map charts with ODS Graphics! The new SAS procedure is called SGMAP.
proc sgmap plotdata=US_GT_200MW; openstreetmap; bubble x=long_num y=lat_num size=MW_total; run;
Like most data analysis work, the heavy lifting is in the data prep. But once you have the response values and coordinates lined up the way that you need them, adding a map is simple.
With the recent update to SAS University Edition, anyone can try out this new feature, even if you don't yet have SAS 9.4 Maint 5 at your workplace. Give it a try!
12-14-2017 07:49 PM
We are looking into it. I would encourage you to report this matter into Tech Support to get it into the formal process.
12-14-2017 10:48 PM - edited 12-14-2017 11:04 PM
I tried to replicate one of the maps in the documentation. I am able to view the graph in the HTML output, but I also get error messages in the log and the PDF and RTF output do not have any graph.
I generated the datasets using SAS 9.4M3 and downloaded them to SAS UE and tried to replicate the graph.
libname mymaps '/folders/myfolders/sgmaps_example'; proc sgmap mapdata=mymaps.nevada plotdata=mymaps.city_pop_xy des='Nevada' ; title 'Nevada County Seat Populations'; choromap / mapid=county; bubble x=x y=y size=population_city / name='cities' datalabel=city datalabelattrs=(color=red size=9 style=italic) ; keylegend 'cities'; run;
Here are the error messages.
NOTE: CHOROMAP statement is pre-production for this release. NOTE: PROCEDURE SGMAP used (Total process time): real time 1.73 seconds cpu time 0.88 seconds ERROR: Physical file does not exist, /tmp/SAS_work0C4F000019C2_localhost.localdomain/_9C8E41015DA3C4EAFFAF7CE05957187.png. ERROR: Physical file does not exist, /tmp/SAS_work0C4F000019C2_localhost.localdomain/_9C8E41015DA3C4EAFFAF7CE05957187.png. ERROR: Physical file does not exist, /tmp/SAS_work0C4F000019C2_localhost.localdomain/_EFDB80C0F401C498835C83B07ABA51D.png. ERROR: Unable to load image /tmp/SAS_work0C4F000019C2_localhost.localdomain/_EFDB80C0F401C498835C83B07ABA51D.png?width=1000px&height=750px&desc=Nevada; default image will be used instead. ERROR: Unable to read the default image. No image will be produced. NOTE: There were 17 observations read from the data set MYMAPS.CITY_POP_XY.
I can prevent the errors by excluding the output from PDF and RTF destinations.
ODS RTF (ID=WEB) exclude all ; ODS PDF (ID=WEB) exclude all ;
Is this because it does not work with PDF and RTF?
Or is there some other reason it doesn't work with these destinations?
This turns out to be a font issue. SAS UE ships with a limited number of fonts to keep the install size small. It turns out that the default ODS styles associated with PDF and RTF are referencing fonts that are not there. Currently, the map renderer is having issues when that fonts cannot be found. To work around this, go into the SAS UE preferences, under the "Results" tab, and change the ODS styles for PDF and RTF to be the same as HTML5 (which is "HTMLBlue"). Other styles might work as well -- just give them a try. We'll get this issue resolved as soon as possible.
Hope this helps!