Closed rjmac closed 1 year ago
This is probably related to https://github.com/georust/geo/pull/943
That seems likely. I think we were only considering polygons when we did #943, which seems like a bug to me.
I think we were only considering polygons when we did https://github.com/georust/geo/pull/943
Sorry, that's not true. I should have reviewed #943 better. It does account for LineString vs. Polygon - but that doesn't preclude an error in the implementation.
Ah-ha, so this conditional block is where the behavior changed - here, in the example above, *simplfied_len
and INITIAL_MIN
are both 2, so it's bailing and returning its input; this condition was not here in 0.23 and it fell through to the next line.
From my understanding of what #943 was doing, this condition should probably be <
, not <=
? Though changing that makes recursion_test
fail. That test is asserting that a simplifcation pass doesn't do anything to a list of coords, but I'm not sure what that test is testing, exactly.
The results of calling
simplify
on a linestring has changed from version 0.23.1 to 0.24.0 - at least sometimes, it appears to be doing nothing at all.I have a reproduction here: https://github.com/rjmac/simplify - it just does
With geo-23 it prints
and with 24,
This is probably related to #943 - I haven't verified it yet, but that's the only thing between the two versions that changed simplify code that I've noticed.