perliedman / geojson-path-finder

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

Never finds a path #73

Closed psociety closed 3 years ago

psociety commented 3 years ago

ty for creating pathFinder!

Version: 1.5.3 Demo: https://jsfiddle.net/6qugy0rm/

I made a simple GeoJSON and i tried to apply the pathFinder but i never get a path :s image (a red path would be painted between those markers if pathFinder had any result)

What i'm missing out?

perliedman commented 3 years ago

Hi, a late reply, but it looks like your start and end coordinates are not part of the graph. I should update the docs, but start and end must be vertices in the routing network.

A common solution is to snap start and end to the closest vertex in the routing network before calling findPath.