Calculate distance between 2 addresses

How can I calculate the distance in kilometers of 2 directions? For example: Carrer de Rabassa 10 (Barcelona) and 20 Grosvenor Hill (London)

Have a look at: Road Routing in R · Jindra Lacko (jla-data.net)

1 Like

Hi, thanks. But for some reason tidygeocoder::geo() returns some NA in some cases

Maybe use another geocoder, or provide more information in the address?

Geocoding - R: Mapping and Geospatial - LibGuides at Duke University

nominatimlite | Connection with OSM Nominatim API • nominatimlite (dieghernan.github.io)

R ggmap - How to Visualize Spatial Data in R - R programming (appsilon.com)

You may consider the Google geocoder; it requires an API key (which is common practice as far as geocoding APIs go - you will find the backend APIs nicely summarised at Geocoding Services • tidygeocoder).

Of all the APIs that I have used it is the most aggressive / likely to find a location (any location) for even malformed input.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.