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

Coordinates for Geo Map

Reply
Frequent Contributor
Posts: 85

Coordinates for Geo Map

Hi All,

I am looking for coordinates for the mentioned address.

The data set has a address column and it contains district names and state names. It is of one column perhaps doesn't have post code.

How to get coordinates as my customer looks for geo map to locate the production units.

Thanks in advance.

regards

Super User
Posts: 1,205

Re: Coordinates for Geo Map

I'm not sure what address you are referring to and what country you are hoping to geocode.

You might find this SAS Global Forum 2013 paper a good reference to understand geocoding and how to do it using PROC GEOCODE - http://support.sas.com/rnd/papers/sasgf13/Geocode2013.pdf

Regular Contributor
Posts: 172

Re: Coordinates for Geo Map

I Use a sas script that requests the longitude/latitude off an address string from google maps.

This way I get all my long/latitudes and use these in SAS VA.

If  you want to solve it this way, I can sent you the related SAS code. It works well for me this way.

Requesting the Centre country long/lat also helps with drilling down. (Also for geo area)

Greetings.

Frequent Contributor
Posts: 85

Re: Coordinates for Geo Map

Yes pls thats would be grt. Thanks Peter.

Pls inbox me.

This thing is that I have already started using the data set and I have produed visualizations, dashboards and explorations. Now I have got a new requirement from the customer to include geo maps.


kindly suggest me how I can run the codes. should I have to create a new SAS data set? will it append as a geo category automatically which is existing in-memory in SAS VA data source?

Regular Contributor
Posts: 172

Re: Coordinates for Geo Map

Hi sat_Ir,

I will sent the full script to your mail account.

Here for all the other interested users.

The main function in SAS is as follows, but still needs some scripting to get ir right.

%MARCRO Url_get_comp(key, street, zipc, city, country);

%LET Url_address="https://maps.googleapis.com/maps/api/geocode/xml?address=&street,+&zipc,+&city,+&country*sensor=fals...";

%LET Url_address=%sysfunc(TRANSLATE(&URL_address,'&','*'));

%PUT &Url_address; FILENAME www url &Url_address;

I create a table that contains the non matched addresses and call on the macro by record.

The received log/lat are stored in the address table and sent to the VA server.

This address table in imported into VA via a data querry and ready for use.

Now Change the role of the address field name to Geography and assign the log/lat under custom.

This field will now ackt as a geo location field.

Greetings and succes.

New Contributor
Posts: 2

Re: Coordinates for Geo Map

Hi, Peter! How are you?

I have recently been playing with the ggmap library in R to do precisely the discussed here: give long/lat for a dataset where I have specific addresses. I just recently discovered that one can do this with SAS. Could you also share your macro code with me? That would be extremely helpful!

Greetings from Mexico

Regular Contributor
Posts: 172

Re: Coordinates for Geo Map

Hi Adriana.

of course you can get the full macro code.

Please give me your e-mail and I will sent it to you.

Greetings from Holland.

New Contributor
Posts: 2

Re: Coordinates for Geo Map

Thank you!

Regular Contributor
Posts: 172

Re: Coordinates for Geo Map

Adriane,

the full scruipt has been sent to your e-mail.

Good luck while implementing it.

Greetings.

Occasional Contributor
Posts: 13

Re: Coordinates for Geo Map

Hi Peter,

Can I receive the full code example as well :-)

Kind regards,

Jesper Bæk Overgaard

Regular Contributor
Posts: 172

Re: Coordinates for Geo Map


Hello Jesper,

here is the code I sadly forgot to append in the past.  (Anna, sorry for that)

greetings and good luck with it.

Community Manager
Posts: 422

Re: Coordinates for Geo Map

Thanks a bunch, Peter.

Jesper, welcome to the community! FYI, I deleted your email address on this thread for security reasons. I hope you have everything you need with Peter's attached code.

Best,

Anna

Frequent Contributor
Posts: 85

Re: Coordinates for Geo Map

Hi Peter,

grt info. thanks very much for the reply. I have created the geo map using your script. Thanks.

satlr

Regular Contributor
Posts: 172

Re: Coordinates for Geo Map

Hi satir,

verry good to hear it works out for you.

Thats what its all about here.

Greetings

New Contributor
Posts: 4

Re: Coordinates for Geo Map

Hi Peter,

could you please sent that code to me?

Thanks

bhagia

Post a Question
Discussion Stats
  • 19 replies
  • 2302 views
  • 13 likes
  • 9 in conversation