1

I have created a web page to test OSRM map match service (running locally in the latest osrm/osrm-backend docker image), before starting to integrate it into my app.

And when sending just 4 locations (by clicking with the mouse) the map matching works well, but when I send 168 real car locations (by copy-pasting JSON data), then it fails with {"message":"Too many trace coordinates","code":"TooBig"} 400 Bad Request:

animated open street map

I have also tested both links against https://router.project-osrm.org with the same result:

The POST method is not supported by OSRM backend, so I have not tried it.

It seems to me that having 168 locations in a real life use case should be nothing unusual for map matching.

For example, when someone returns from a day long bycicle trip and wants to see it on the map.

My question is: do you encounter the same issue #6612 with OSRM map matching and what are your strategies to workaround it?

1 Answer 1

1

You can set service specific payload sizes on engine boot via osrm-routed CLI flags¹:

docker run -t -i -p <port:port> -v "${PWD}:/<pwd> <path/to>/osrm-backend osrm-routed --algorithm <MLD/CH> --max-matching-size <value> <path/to/graph>.osrm

where --max-matching-size <value> defines the allowed input trace size.


¹ AFAIK these are undocumented except for in man, i.e. osrm_routed --help

1
  • Running the docker image with docker run --name osrm -t -i -p 5000:5000 -v c:/repos:/data osrm/osrm-backend osrm-routed --algorithm mld --max-matching-size 1000 /data/germany-latest.osrm has helped me, thank you Commented Apr 22, 2023 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.