开发者

package for geocoding (street location!) and next calculation of distance

开发者 https://www.devze.com 2023-02-10 22:04 出处:网络
EDIT: And package for not geographical distance between two lan-long points, but distance by car, or foot (like this http://code.google.com/intl/sk/apis/maps/documentation/directions/) Travel mode - d

EDIT: And package for not geographical distance between two lan-long points, but distance by car, or foot (like this http://code.google.com/intl/sk/apis/maps/documentation/directions/) Travel mode - driving, walking. No map, just distan开发者_Python百科ce. Thanks for any idea.


Hello. I search package in R, what gives me longtitude and latitude for data frame with 10000 locations like this "STREET, town, Europe".

And then package, what gives me distance per haversine formula for those locations. But mainly package for lat-long.. Distance should be easy.

I searched a lot but found nothing useful for me. Thanks for help! I hope that R knows it :)


Package dismo has address level geocode(), though installation can be difficult on some platforms.

Package sp has WGS84 ellipsoidal distance in spDistsN1().


Getting street locations is going to need google's help or similar. Or possibly OpenStreetMap, but I'm not sure what the API is:

http://nominatim.openstreetmap.org/

For just cities, search the geonames database for populated places 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


You may use function 'mapdist' in 'ggmap' package


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

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

For distances along roads etc perhaps you can use igraph


You could try looping through your addresse using this method.

Or leave R and take advantege of Python's geopy.

0

精彩评论

暂无评论...
验证码 换一张
取 消