-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-simplify simplifies linestring as if start and end points are connected #573
Comments
You may find that the Douglas Peucker method does a better job of simplifying this kind of linework than the default method (which is based on Visvalingam's algorithm). So try adding |
Thanks - DP does the same thing. It believes the last point in the line is connected to the first point. Perhaps this is mathematically correct, so not something which needs 'fixing'. My solution is to iterate the points and ensure none of them are at the exact same coordinates as the others by introducing some jitter. I can't see any other way to resolve this. |
Perhaps this is intentional, but if I have a LineString of, say, 100 points where the final point is identical to the first point (this happens a lot on plotted GPS routes), simplifying this line has a tendency to remove a chunk of the start or end of the line. It appears as though mapshaper considers this a continuous line and so simplifies away the first/last point. See attached. If you simplify this any amount significant amount the start and end disappear. Moving the start/end even marginally removes this behaviour.
Is this intentional and is there anything that I can do to prevent it, other than tweaking the points slightly to prevent them being snapped together
example.txt
The text was updated successfully, but these errors were encountered: