BookmarkSubscribeRSS Feed
KevEile
Calcite | Level 5

I'm using SAS Enterprise Guide v5.1 and currently have a table that looks like the following

 

Address

123 Street Name, Town, Ireland

456 Big Road, Other Town, Ireland

etc.

 

Can anyone please tell me how to connect to Google Maps API (preferably the free version that allows up to 2000 searches) and determine the geographical co-ordinates of the addresses in the table? I wish then to create a new table that looks like:

 

Address                                                       Latitude                  Longitude

123 Street Name, Town, Ireland                  1.23456                    6.54321

456 Big Road, Other Town, Ireland              5.67890                   0.98765

etc.

6 REPLIES 6
Reeza
Super User

Have you considered PROC GEOCODE, especially if you have SAS 9.4

 

http://support.sas.com/documentation/cdl/en/graphref/67881/HTML/default/viewer.htm#p087i29802bnfgn1q...

 

You may need to download a dataset for it to work for Ireland.

KevEile
Calcite | Level 5

Hi Reeza,

 

Yes, I considered using PROC GEOCODE but it seems to be catered specifically for USA/Canada/UK (anywhere with a definied postal code system such as zip codes) and not for Ireland

 

That's why I'm wondering specifically about the Google Maps API

 

Also, I have SAS 9.3

Reeza
Super User

Here are two examples. One issue is that they wrote them a while back and the API changes over time.

 

I think the second one has been maintained over time. I do know that it's still possible 🙂

 

http://www.sascommunity.org/wiki/Geocoding_using_SAS_and_Google_Maps

 

http://www.sascommunity.org/wiki/Driving_Distances_and_Drive_Times_using_SAS_and_Google_Maps

 

 

KevEile
Calcite | Level 5

Reeza,

 

Thanks for digging these out for me. Unfortunately I have not been able to adapt these to work for me

 

From the first source, http://www.sascommunity.org/wiki/Geocoding_using_S​AS_and_Google_Maps, I get the following errors

 

ERROR: Host name maps.google.com not found.

ERROR: Physical file does not exist, C:\GoogleGeocode\Googlexml2.xml.

 

  • There doesn't appear to be any reference to what this XML file contains

 

ERROR: Physical file does not exist, C:\GoogleGeocode\Googlexmlmap.map.

ERROR: Encountered during XMLMap parsing at or near line 1, column 1.

ERROR: XML describe error: Internal processing error.

 

  • I have created the .map file exactly as specified but it seems to be causing errors. I have no experience with XML at all so I'm wondering if you have been able to get it to work?

 

 

 

Reeza
Super User

I know the second one works...

JamieFay
Fluorite | Level 6

What is the minimum version number of Enterprise Guide this will work with please?

 

I'm using EG 6.1 and I'm being told by our IT support team that the reason I'm getting a "Host not Found" error is because this isn't supported in the version we run, and nothing to do with the setup or my access priviledges.

 

Thanks,

 

Jamie

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 970 views
  • 0 likes
  • 3 in conversation