I have a data set that includes a list of zip codes. Is there a way in R to convert these zip codes to latitude and longitude coordinates?
|
There's no strict algorithmic relationship between latitude and longitude and zip code - they're all custom areas generated by the postal service. You need access to a dataset that codes polygons / polygon centroids by zip code. 1) Complex Traditionally, this task (coupled with address lookup) is termed 'Geocoding'. The most convenient method for full address lookup is to find a preexisting online geocoder, whether by Google Maps, Bing Maps, or ESRI. 2) Simpler For just US zip codes, though, there is data available from the Census: http://www.census.gov/geo/www/cob/z52000.html I'm not familiar with R geospatial capability, but all you should need is polygon->centroid, and centroid->coordinates. 3) Simplest This task is common enough that a preexisting centroid dataset exists: http://coolthingoftheday.blogspot.com/2008/04/free-us-zip-code-database-as-csv.html |
|||
|
|
|
I use the |
|||||||||||||
|
|
have you looked at the |
||||
|
|
|
Seems like you are using Ruby on Rails |
||||

