Matrix API returning "Null" for multiple locations

Hello,

I am having an issue with the Matrix API returning “Null” as the distances for a couple locations (long/lat) that I’m passing in.

Some example locations that are returning “Null”:
Big Bend National Park [-103.250452, 29.250201]
Biscayne National Park [-80.13989, 25.41206]

Even when I pass these locations into the API Playground for this service, the response is returning “Null” for the distances. The response itself is successfully, but the values in distances are “null”

I checked that these long/lat values were valid using the Geocode/Reverse and it had a successful response to the exact location.
Geocode/Reverse/Get

Please let me know if I can provide any additional details!
Thanks,
Dearmadillo

I had a similar problem with lakes that I was passing in. Turns out that the maximum snapping radius on the online ORS API playground is hard coded for 300 m and cannot be changed. As a result, if it couldn’t find a road within 300 m of the long/lat, it would return a null.

I solved this, with lots of help from the ORS forum here, by setting up my own server and running the ORS software on my system, where I changed it from 300 m to 5,000 m.

Hope that helps.

gwfami

1 Like

hello @gwfami2, are you still here?

could you please share the configuration of changing maximum snapping radius, because i don’t know if i changed it right or not but it didn’t work

here my yml file and i run the server with the jar file

ors:
  engine:
    source_file: vietnam-latest.osm.pbf
    profiles:
      car:
        enabled: true
        maximum_snapping_radius: 5000

request body

{
    "locations": [
        [106.817363,10.959099],
        [106.876925,10.950812]
    ],
    "metrics": ["distance"],
    "units": "m"
}

thanks,

Please note that in order to adjust the snapping radius for matrix you need to edit the config parameter ors.endpoints.matrix.maximum_search_radius, not ors.engine.profiles.car.maximum_snapping_radius. Also, there is currently one open issue with the service, which you might run into at some point…

Yes, I’m still here. Did andrzej’s answer fix your problem?

1 Like