Path to a list of equally-spaced points

Hello everyone,

I successfully used the java code for routing computation, i.e. given two points the GraphHopper engine computes alternative routes making available a list of key points. Anyway I currently have a specific need: a list of equally-spaced points covering all the proposed route.
One way in order to reach this goal is to fill the gap between two points with the necessary points along the straight segment between them. Anyway this solution fails when the two point are far etch-other and positioned on a curved line because the filler points will not match the street.

Can you kindely suggest me a way to reach my goal? I was exploring the map-matching module but I’m not sure the it will finally provide what I need and I’m afraid that there exist a simple way I currently can’t see.

Anyway this solution fails when the two point are far etch-other and positioned on a curved line

If there would be a curved line we would return the geometry appropriately. So inserting points like you suggested should work.

Yes, you are right, but I was considering the simple case of computing the middle points not considering the map constraint.
So, you say that using the map-matching I could retrive a dense list of equally spaced points? Can you kindly suggest a link showing some sample code close to this problem?

Be it for the Routing or Map Matching API: you’ll always get back all necessary points to follow the real world road (if correctly mapped), not more but also not less points. So, it is NOT equally spaced. This is something you’ll have to do.