mapshaper icon indicating copy to clipboard operation
mapshaper copied to clipboard

some features are lost when -clean

Open fran2a opened this issue 2 years ago • 6 comments

Hi,

I have an issue when applying -clean option on some data, I lose some features...

Here the test datas: https://e-nautia.com/fmp2a/disk/public/temp1.zip

Thanks

fran2a avatar Jun 01 '22 21:06 fran2a

I'll look into this... thanks for attaching a sample dataset :)

mbloch avatar Jun 01 '22 22:06 mbloch

I see what you mean... I will work on fixing this. Geometry errors like this can be hard to debug and fix, so it might take me a while.

mbloch avatar Jun 03 '22 16:06 mbloch

Many thanks.

fran2a avatar Jun 03 '22 21:06 fran2a

Just for my information, what kind of geometry errors have you noticed? Thanks

fran2a avatar Jun 04 '22 23:06 fran2a

In my experience, geometry errors like this are generally related to the limited precision of JavaScript's floating point math operations. The -clean function detects all the places where pairs of line segments intersect each other. When two line segments are almost-but-not-quite parallel, or a vertex of one segment is located almost exactly along the second segment, then it becomes harder to reliably test if the segments intersect.

mbloch avatar Jun 05 '22 04:06 mbloch

Hi. No news on this issue? Seems to be challenging? With my respect.

fran2a avatar Jul 06 '22 21:07 fran2a