osrm icon indicating copy to clipboard operation
osrm copied to clipboard

Is snaping coordinates to the street network possible when mapping isochrones?

Open aTnT opened this issue 1 month ago • 0 comments

Hello,

First of all thanks for developing this amazing package!

I obtain the map below as the result of running:

  example_isochrone <-
    osrm::osrmIsochrone(
      loc = c(5.653536, 53.019535),
      breaks = seq(0, 30, 5),
      osrm.profile = "car",
      res = 100
    )

image

As you can see the iscochrones have plenty of "small polygon islands", i.e. areas with larger travel times than the surrounding. I believe this is because the random points are in agricultural fields away from the street network leading to larger travel times.

In my workflow i need to do a spatial join between these isochrones and other geospatial vector data, but because of these "small polygon islands" i get plenty of nonsensical results. I need to filter out these small islands.

I have noticed the osrm::osrmNearest() function that snaps a coordinate to the street network, but is it possible to call it as part of the osrm::osrmIsochrone() function call in order to force the sample points to be on the road network and hence remove these small islands? Or any hints on how i could filter out these islands?

Thanks for reading.

aTnT avatar May 13 '24 09:05 aTnT