BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
don_data
Fluorite | Level 6

Is there a lookup table for Canadian cities (eg: Vancouver, Calgary, Winnipeg) that is similar to the country lookup below:

http://support.sas.com/rnd/datavisualization/va63geo/subdivs.html

 

Thanks. 

1 ACCEPTED SOLUTION

Accepted Solutions
Sam_SAS
SAS Employee

Take a look at this thread:

https://communities.sas.com/t5/SAS-Visual-Analytics/Coordinates-for-Geo-Map/m-p/187450/highlight/tru...

 

There is a SAS macro script attached to the 11th post on that thread that uses Google APIs to geocode. The script itself is pretty arcane but some users on that thread apparently had success with it.

 

On the other hand, since you only need cities (as opposed to street addresses), you might want to search for a city coordinates table (for example, here https://www.maxmind.com/en/free-world-cities-database) and join these latitude and longitude variables into your data set.

 

 

Thanks,

Sam

View solution in original post

3 REPLIES 3
Sam_SAS
SAS Employee

Hi Don,

 

We might add an easier way to map cities in the future, but currently you will need to add the city coordinates to your data set and then define a geography using custom coordinates.

 

If you have VA 8.2, or if you have a SAS/GRAPH license, then you can use the GEOCODE procedure to add the city coordinates to your data.

 

You can find documentation for GEOCODE here:

http://documentation.sas.com/?docsetId=grmapref&docsetTarget=p087i29802bnfgn1qn9isdqzde0h.htm&docset...

 

In particular, Example 5 should be helpful.

 

If you don't have access to GEOCODE, it is possible to add coordinates to your data in other ways but it is less convenient.

 

Let us know if this helps.

 

Sam

don_data
Fluorite | Level 6

Thanks. Unfortunately, I do not have a SAS/GRAPH licence. Would you be able to provide me with the alternate method. 

 

Thanks

Sam_SAS
SAS Employee

Take a look at this thread:

https://communities.sas.com/t5/SAS-Visual-Analytics/Coordinates-for-Geo-Map/m-p/187450/highlight/tru...

 

There is a SAS macro script attached to the 11th post on that thread that uses Google APIs to geocode. The script itself is pretty arcane but some users on that thread apparently had success with it.

 

On the other hand, since you only need cities (as opposed to street addresses), you might want to search for a city coordinates table (for example, here https://www.maxmind.com/en/free-world-cities-database) and join these latitude and longitude variables into your data set.

 

 

Thanks,

Sam

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1096 views
  • 0 likes
  • 2 in conversation