New blog post! We're about to embark on an 18-state, 5,000+ mile road trip (😱), so I figured I'd visualize it with #rstats and {sf}! Here's how to automatically get geocoded location and routing(!) data from OpenStreetMap and make fancy maps with ggplot #dataviz #rspatial andrewheiss.com/blog/2023/06/0

@andrew great stuff I’ve actually been searching for a post like this recently and that’s awesome.

If you ever want to go to next level- there are some use cases where people want to route or geocode without sending the data to another service (eg you have confidential data and cannot share it). I’d love to see someone show how to do these things locally. I saw there is an R package called dodgr that should be able to do this with osm data but haven’t seen it being implemented.

@mpanhans I *think* you can run a whole local instance of OSRM that doesn't phone out anywhere (like through docker github.com/Project-OSRM/osrm-b or just on a linux server), and it looks like you have to supply it the raw OSM files and it handles all the routing locally. There's an argument to osrm::osrmRoute() that lets you specify the server, so I think you could just point it to localhost:5000 or wherever and it would work the same way

Follow

@andrew Brilliant, I think you are right, I am going to dig deeper into this. Thanks!

@mpanhans And it looks like Nominatim (for geocoding locations) can also run from Docker or locally nominatim.org/release-docs/lat, so it should theoretically be possible to have non-remote instances of Nominatim and OSRM for locations and routing

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml