GIS

noetsi

Fortran must die
#1
Is there an R package that will tell you the distance between two points in the US if you put in the address (essentially GIS software).
 

trinker

ggplot2orBust
#8
If you need the addresses as lat an long....There's lots of ways to do this. This is one approach: https://github.com/trinker/mapit/blob/master/R/geo_code.R (if it still works). This approach requires authentication and tokens but isn't too bad to do. You're just restricted on the number of requests per time period. Do small batches (If I remember correctly like 5K a pop) and save the results to an .rds and then read in all at once and combine.

If zips distances are fine then the zip package has you covered.

Once you have the long and lats it's a matter of the distance formula: https://stackoverflow.com/questions...-distance-between-two-points-lat-long-using-r
 

trinker

ggplot2orBust
#9
Tried this and it still works so:

Code:
install.packages('devtools')
library(devtools)
install_github('trinker/mapit')
library(mapit)

wh <- geo_code(
   street = '1600 Pennsylvania Ave',
   city = 'Washington',
   state = 'DC',
   zip = '20500',
   api.key = 'signup to get yours free'
)

##   latitude longitude
## 1 38.89768 -77.03655
This is a pay it forward from bryan goodrich who helped me with GIS stuff when I was interested
 
Last edited: