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 distance. 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With