geojson-path-finder icon indicating copy to clipboard operation
geojson-path-finder copied to clipboard

FeatureCollection of multiple LineString features

Open benistary opened this issue 6 years ago • 6 comments

Hi, I've found your package and it's really awesome! But, is possible to apply pathFinder function on featureCollection of miltiplne lineStrings ? Because it seems that's not working. I'm working on Indoor Navigation based on QRcodes and I want to create big graph, where can I search shortest way.

benistary avatar Feb 27 '18 11:02 benistary

Hi, yes, it should work with a FeatureCollection on multiple LineStrings. In fact, that's exactly the data I use it for.

For example, check out this GeoJSON that we use in the tests: https://raw.githubusercontent.com/perliedman/geojson-path-finder/master/test/network.json

If this causes trouble, please provide some more details about your GeoJSON and the issue you're seeing.

perliedman avatar Feb 27 '18 12:02 perliedman

Hi, i have the same issue where i tried your test data with , but i always have an error in the turf explode function

untitfeled untitled

maissenayed avatar Feb 28 '19 10:02 maissenayed

@maissenayed hard to tell without seeing it running, but my guess is that you are using a newer version of the Turf modules, which are written with ES modules in mind. This means that the functions from Turf should now be imported like this:

var explode = require('@turf/explode').default;

Might this be the problem?

perliedman avatar Feb 28 '19 11:02 perliedman

i tried that but still the same problem , i'm using mapbox-draw-plugin ,where i draw LineStrings, and then use Draw.getall , to get my geojson , and yes using the latest turf.js lib,what can i provide so we can tackle this problem ???

maissenayed avatar Feb 28 '19 11:02 maissenayed

I would just check in devtools what explode is actually set to, it should be pretty straight forward to debug.

perliedman avatar Feb 28 '19 13:02 perliedman

@maissenayed hard to tell without seeing it running, but my guess is that you are using a newer version of the Turf modules, which are written with ES modules in mind. This means that the functions from Turf should now be imported like this:

var explode = require('@turf/explode').default;

Might this be the problem?

I had the same issue and .default fixed it

mabdulhalim avatar Jun 27 '19 19:06 mabdulhalim