From: Nils Date: Wed, 29 Nov 2023 12:06:41 +0000 (+0100) Subject: Use 5 meter radius for input locations in Valhalla X-Git-Tag: live~865^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/9f704f1d4ec0bf5685939aa4f5cb9fb6854a24bc?ds=sidebyside;hp=45f0589e624f111ffe85cf9c17bf43be8b839f2c Use 5 meter radius for input locations in Valhalla This will search for road segments within 5 meter radius of the input location and choose the best path from/to whichever segment gives the cheapest cost. It should be preferable in most scenarios compared to simply snapping to the closest segment. I'll do the same PR for our web app at https://github.com/gis-ops/valhalla-app. --- diff --git a/app/assets/javascripts/index/directions/fossgis_valhalla.js b/app/assets/javascripts/index/directions/fossgis_valhalla.js index 0bf6a3a8d..d44dbd12b 100644 --- a/app/assets/javascripts/index/directions/fossgis_valhalla.js +++ b/app/assets/javascripts/index/directions/fossgis_valhalla.js @@ -53,7 +53,7 @@ function FOSSGISValhallaEngine(id, costing) { data: { json: JSON.stringify({ locations: points.map(function (p) { - return { lat: p.lat, lon: p.lng }; + return { lat: p.lat, lon: p.lng, radius: 5 }; }), costing: costing, directions_options: {