Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Canadian Cities geographic lookup table

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Canadian Cities geographic lookup table

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. 


Accepted Solutions
Solution
‎03-21-2018 10:53 AM
SAS Super FREQ
Posts: 322

Re: Canadian Cities geographic lookup table

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


All Replies
SAS Super FREQ
Posts: 322

Re: Canadian Cities geographic lookup table

[ Edited ]

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

Occasional Contributor
Posts: 9

Re: Canadian Cities geographic lookup table

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

 

Thanks

Solution
‎03-21-2018 10:53 AM
SAS Super FREQ
Posts: 322

Re: Canadian Cities geographic lookup table

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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