mclaeysb / simplepolygon

JS tool to break self-intersecting GeoJSON polygons down in their constituent non-self-intersecting parts
MIT License
82 stars 11 forks source link

One Step Closer #13

Closed DenisCarriere closed 7 years ago

DenisCarriere commented 7 years ago

Just noticed some positive changes in v1.2.0.

Still not 100% there yet, but better than before, only splits 1 geometry.

Using this complex.geojson

image

Before to v1.2.0

image

Now v1.2.0

image

mclaeysb commented 7 years ago

Did you npm update to use the newest version of geojson-polygon-self-intersections? As mentioned in #7, this should fix your issue!

DenisCarriere commented 7 years ago

🤔 I don't get it.. why would I need to npm update? Why wouldn't you update your dependencies directly in your module?

DenisCarriere commented 7 years ago

Still no change... Even hardcoded the dependencies to the specific latest versions:

"dependencies": {
  "geojson-polygon-self-intersections": "1.1.2",
  "simplepolygon": "1.2.0"
}
DenisCarriere commented 7 years ago

We've added it to your local tests, same results.

https://github.com/mclaeysb/simplepolygon/blob/master/test/out/complex.geojson

mclaeysb commented 7 years ago

If my understanding is correct, npm update will update all dependancies, including geojson-polygon-self-intersections to 1.1.2. Just pushed simplepolygon again te make sure it's requiring it.

test/in/complex.geojson seems to give correct results here. Not sure why you're getting something else. How could we find out?

DenisCarriere commented 7 years ago

Oops 🤓 Yea I thought it was only returning 2 features, but that's because the output color ramp only had two colors.

👍 Works

Handling these kinds of "complex" shapes can be a mess, I wouldn't want to attempt doing this, thanks for help & contributions to this module!

image

mclaeysb commented 7 years ago

Great! Glad I could be of help. Congrats with the turf release btw!

DenisCarriere commented 7 years ago

Thanks! 👍 Things tend to blow up every time we push a big release, lol that's why I noticed your library changed.

Any chance that simplepolygon will support MultiPolygon?

We've got flattenEach that can help with that.

Also noticed you might be another user of this newly proposed ringEach feature in @turf/meta (from @rowanwins ).

mclaeysb commented 7 years ago

Thanks for pointing this out. I don't currently have plans to develop simplepolygonfurther. Will let you know when that's the case, and take a look at these then!

DenisCarriere commented 7 years ago

👍 No worries, I know it's a lot of work :) If ever you do, check out those new Turf features.