perliedman / geojson-path-finder

Find shortest path through a network of GeoJSON
https://www.liedman.net/geojson-path-finder/
ISC License
301 stars 87 forks source link

navigation information #22

Open bertrandmd opened 6 years ago

bertrandmd commented 6 years ago

Hi @perliedman ! Do you have any idea if it's possible to create/extract navigation data from a geojson ? It could be amazing to add this to geojson-path-finder response ! thanks for your work!!

perliedman commented 6 years ago

Hi! Could you elaborate on what you mean by "navigation data"?

In general, GeoJSON is such a general format that it's hard to make any assumptions on what data you can extract, except for the actual geometry.

bertrandmd commented 6 years ago

Hi, I am referring to the guidance instructions as they are used in Leaflet Routing Machine (go straight XX meters, turn right, ...) I don't know if it's possible to create this from geographical topology.

perliedman commented 6 years ago

Ok, I see. I think it's outside the scope of this project, but I can see the need.

What I think would need to be done in GeoJSON Path Finder is to break down the path into segments (compared to the array of coordinates we use now), that could then be turned into instructions.

I'm happy to answer questions to help out if this is something you or someone else would be willing to take on, but since I don't have this use case at the moment, I don't think it's something I will take on myself at this point.

bertrandmd commented 6 years ago

I could be interested by doing this, do you have some tricks for transforming segments in instructions ? Thanks

perliedman commented 6 years ago

If the route is turned into segments (by "segment", I mean that the route is split on each node it passes, to make it clear where turns are made, etc.), I think you could figure out turn angles etc., which you could use to produce things like "turn left", etc.

For better instructions, you would have to map street names or things like that to properties of the GeoJSON.

ValarMorghulis12138 commented 2 years ago

This is exactly what I have done in my project 😂. It's not perfect, but quite enouth for current customer need. AND now it's year 2022, really grateful for your amazing library "geojson-path-finder" and "leaflet-routing-machine". Men, you are the best!

If the route is turned into segments (by "segment", I mean that the route is split on each node it passes, to make it clear where turns are made, etc.), I think you could figure out turn angles etc., which you could use to produce things like "turn left", etc.

For better instructions, you would have to map street names or things like that to properties of the GeoJSON.