Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Maps in Stata: how to match lat/long to shape file?


From   Joe Canner <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Maps in Stata: how to match lat/long to shape file?
Date   Mon, 18 Nov 2013 14:11:51 +0000

One possibility would be to use -geocode3- (available via SSC) which uses Google Maps to translate addresses into latitude/longitude and vice versa. The documentation for -geocode3- is a little confusing for this so here is an example:

. geocode3, coord(varname)

Where -varname- is a string variable containing the latitude and longitude separated by a comma, e.g. "47.99,16.93"

The program will create a new variable which is the complete address, which you can parse to get the state.

Be aware, however, that there are daily limits on the use of Google Maps and there are restrictions on how you are allowed to use Google Maps.  These limits and restrictions are given in the -geocode3- help file.

Another possibility is -gpsmap- which was presented at the Stata meeting in New Orleans last July.  I think it does something like what you are asking.  Perhaps the author can provide you with a copy.  See http://www.stata.com/meeting/new-orleans13/abstracts/materials/nola13-brophy.pptx for his presentation, which includes his contact information.

Regards,
Joe Canner
Johns Hopkins University School of Medicine‎

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Sunday, November 17, 2013 11:11 PM
To: [email protected]
Subject: st: Maps in Stata: how to match lat/long to shape file?

Hello,

I have a dataset that has a list of points with lat/long coordinates for each of them and I have the shape file for a country with state boundaries. I would like to generate a third dataset that tells me in what state each of the points is, and do things like calculate number of points by state.

What are my options for doing this? I've looked at spmap / tmap / sh2dta but nothing so far.

Thanks,
JY





----
Sent using GuerrillMail.com
Block or report abuse: https://www.guerrillamail.com/abuse/?a=UlV1EQwMSqcBqAan4HYMZxqVA8KRwMFR1aAMedvj




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index