Geocoding package (street location!) And the following distance calculation

EDIT: And a package for not the geographic distance between two long points, but the distance by car or foot (e.g. http://code.google.com/intl/sk/apis/maps/documentation/directions/ ) Drive mode is driving, walking. No map, just distance. Thanks for any idea.


Hello. I am looking for a package in R that gives me longitude and latitude for a data frame with 10,000 locations, such as "STREET, city, Europe".

And then a package that gives me the distance to the haversin formula for these places. But basically a package for lat-long .. The distance should be easy.

I searched a lot, but did not find anything useful to me. Thanks for the help! Hope R knows this :)

+5
source share
5 answers

The package dismohas an address level geocode(), although installation may be difficult on some platforms.

The package sphas an WGS84's ellipsoidal distance spDistsN1().

+3
source

Getting street locations will require the help of Google or the like. Or maybe OpenStreetMap, but I'm not sure what the API is:

http://nominatim.openstreetmap.org/

For simple cities, find the geonames database for populated areas using my geonames package:

>library(geonames)

> GNsearch(q="Toronto",fcode="PPLA")
  countryName adminCode1           fclName countryCode      lng
1      Canada         08 city, village,...          CA -79.4163
                                      fcodeName toponymName fcl    name fcode
1 seat of a first-order administrative division     Toronto   P Toronto  PPLA
  geonameId      lat adminName1 population
1   6167865 43.70011    Ontario    4612191
+2
source

'mapdist' 'ggmap'

+2
source

See the geosphere package for distances between lon / lat points.

'gdistance' does things like cost-distance (on grids).

For distances along roads, etc., perhaps you can use igraph

+1
source

You can try to loop through your address using this method.

Or leave R and take advantage of Python geopy .

0
source

All Articles