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

edgeDataReduceFn Example #40

Open chadmpdev opened 6 years ago

chadmpdev commented 6 years ago

Could you share an example on how to use edgeDataReduceFn. I have street names and other properties on my geojson but I cannot seem to get the edgeDataReduceFn function to work properly. I would appreciate any working example. Thanks!

perliedman commented 6 years ago

Hi, sorry for a late reply.

I have no example at the moment, and don't really have the time or energy to make one at the moment, but this is a good idea, so I'd like to keep this issue open to remind me to add this at some point in the future!

crizzis commented 2 years ago

For anyone coming here from Google: I figured out that the edgeDataReduceFn acts both as an accumulator and a combiner in the reduction operation, i.e. the right operand is either GeoJsonProperties, or a result of a previous reduction.

Hopefully someone will spend less hours trying to figure it out now.