Hi,
I'm a novice with GMAPs and I'm trying to create a Us/Canada chart with bars (values to be determined by the data) for particular cities in both US and Canada. I'm finding the USCITY_ALL dataset in the MAPSGFK library works well for mapping to US cities. Is there a similar map for Canadian cities? ...Or is there another way to do it for Canada that I'm not aware of?
Thanks!
What version of SAS do you have?
If you're 9.3+ I think you need to be using MAPSGSFK instead?
And you can download some custom files from here : http://support.sas.com/rnd/datavisualization/mapsonline/html/home.html
Hi,
I'm using the MAPSGSFK one. Still didn't see a table that had the Canadian cities. Is there one?
Thanks.
Did you check the link? It has a sources that is available, one with city locations including 218 Canadian cities. I don't know if that would encompass your list of cities. You probably already know, but there are specific definitions for City/Town/Summer Village/Special Area etc.
I don't know what you're trying to do, but Statistics Canada has a lot of SHP files available here:
http://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/bound-limit-2016-eng.cfm
And depending on where you work, you may have access to a file called PCCF that maps postal codes to a latitude and longitude.
If you're looking for basic lat/long for Canadian Cities you could probably wrangle one of the StatCan files into what you need.
And SAS provides code/process if you purchase the lookup table from zipcodedownloads.com
Hi,
The link provided seems to point me to the MAPSGFK library, and to the WORLD_CITIES table. This works for a lot of my data but I have many cities that don't show up in the WRLD_CITIES table, not sure why:
AJAX ON
AYR ON
DARTMOUTH NS
DELTA BC
DORVAL QC
ETOBICOKE ON
HANWELL NB
LEVIS QC
LIVELY ON
MAIDSTONE ON
MISSISSAUGA ON
PEACERIVER AB
SAINT-HYACINTHE QC
SAINT-PRIME QC
SAINT-REMI QC
SOUTHGLENGARRY ON
STONEYCREEK ON
Not all of those are classified as Cities is one reason, some are towns or regional districts or components thereof.
If you only have the few I'd probably just look them up on Google and add the coordinates in manually.
Or, check the Open Data portals or here:
Ahhhh....but alas, I'm only on 9.4.3. It looks like WORLD_CITIES_ALL is only available to SAS 9.4.5. Bummer!
Regarding the Open Data Portals link you sent, I wouldn't even know where to begin...I just want Canadian cities with lats and longs 😞
Thanks for your help!
No, I have 9.4 M3 and found the ALL file online in the first link.
It's long and slightly painful, but you can use PROC GEOCODE to derive them...there should be a simpler way.
http://support.sas.com/resources/papers/proceedings10/332-2010.pdf
This will likely give you every city, but it's a long route.
If you only have the few missing you listed, I would probably be lazy and do it manually. The approach above is automated but longer.
Ok, found it. Was looking in the wrong link. Just downloaded and , wouldn't you know it, the cities I need are still not there. I guess I'll have use the proc geocode to create derive them...Lord help me. I'm really a novice and very new at this whole 'GEO' mapping and graphing thing.
Again, thanks for all your help!!!
Most places have another look up table that simplifies this, but unfortunately it's proprietary data.
I've assumed you're a student and have no access to other sources. Otherwise, most companies and governments have different sources 🙂
No, not a student. I work for a Volvo Trucks North America. My access to SAS is limited to SAS EG on a CITRIX box linked to a server in Sweden. I don't have a lot of latitude with adding or changing system libraries, files and the like. I've got some reading and learning to do.
Then ask around your company. I'm surprised they don't have a GIS unit, I'd suspect you do somewhere and they'll have the data you need. You can also purchase the data here:
This is the one recommended by SAS and is dirt cheap.
An option we use internally here is:
There's a file that can be purchased from Statistics Canada or Canada Post and I'd be surprised if your marketing team didn't have a copy of that.
Good Luck!
Ok, will do. Again, Thanks for your help and attention on this 🙂
If the cities aren't in mapsgfk.world_cities, you might can look them up manually in Google maps, and then enter the lat/long into a dataset...
For example, go to maps.google.com
Search for "Levis, Canada"
Then look in the URL, and pick out the lat/long, such as "@46.710684,-71.255107", and copy-n-paste those numbers into your file/spreadsheet/wherever.
It's a bit tedious, but it's one way to get the job done.
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 16. 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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: