0

Is there a function that returns the zipcode (or closest zipcode) for a given longitude and latitude.. It needs to scale because I have a long list of latitude by longitude

Gabriel
  • 71
  • 1
  • 1
  • 3
  • Look into Google maps geo coding api – ajon Mar 10 '15 at 04:10
  • Possibly interesting: http://stackoverflow.com/questions/8751497/latitude-longitude-coordinates-to-state-code-in-r – Nitish Mar 10 '15 at 04:10
  • 1
    Read the [R documentation](http://cran.r-project.org/web/packages/zipcode/zipcode.pdf) for the zipcode package. Going from zipcode to latitude/longitude is easy, but the other way around will take a bit of effort on your part. – Tim Biegeleisen Mar 10 '15 at 04:14

2 Answers2

0

A.1) You can download tables that contain the approximate coordinates of Zip Codes. For small zip codes area, it can be precise, but for large area in less populated zones, the coordinates would just be the middle point.

Maybe look at some search results: http://zips.sourceforge.net/

A.2) Then you can join your list of zip codes to get the coordinates.

B) You can try to use geocode from ggmap package

Further readings: https://gis.stackexchange.com/questions/28035/how-to-convert-zip-codes-to-latitude-and-longitude

Community
  • 1
  • 1
Kvasir EnDevenir
  • 907
  • 1
  • 10
  • 25
0

Actually I was looking for a subroutine in R. I tried zipcode package but it didn't work too well.. I basically have a long list in longitudes and latitudes and need corresponding (or nearest) zip codes

Gabriel
  • 71
  • 1
  • 1
  • 3