Hello!
I am trying to use sas mapsgfk.world dataset. I have a separate dataset where latitudes and longitudes are collected in decimal degrees. Mapsgft.world has LONG, LAT, X and Y variables.
The values in LONG, LAT doesn't match entirely with the dataset I have.
Ex: From within united states, I have co-ordinates longitude: -164.7520065 and latitude:64.4912815 in my dataset however, this does not match any latitude longitude co-ordinates from mapsgfk.world so I can use these as id variables in proc gmap.
Any thoughts please?
@Tommer wrote:
Posted the code above. Any idea if I am doing something terribly wrong?
Using LONG as an ID variable.
If you examine the map data set the ID variable is using a two letter country abbreviation as the ID, i.e. AD for Andorra.
So none of your Long values will match the ID in the map data set.
I don't know what you may have used before but with this map data set you would have to provide an ID that matches. Which means doing some Geocoding to get the the country code to add to the summary values before mapping.
@Tommer wrote:
Thanks ballardw, I added the ID variable in my dataset too for country code and I could generate the map. However, what I was looking for is drilling down to specific location within the country. Using country code as ID, it helps in showing the data for country but not for specific location within the country. Hence, I was using ID variable as LONG.
Is it possible to drill down to specific location within country?
Specific location within an area in Gmap usually means an Annotate data set. You add some extra variables to describe what you want to appear, such as marker size and shape and/or text, along with the coordinates to place the information.
There are a number of examples at https://support.sas.com/sassamples/graphgallery/PROC_GMAP_Graph_Elements_Annotation.html
Example Sample 24906 shows placing city markers and names on a world map using the Maps.world map data set. Similar should be an easy transfer the the GFK version if you use the LATLON option you wouldn't need to project your coordinates.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.