Skip to content
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

Set minimum points for a VisvalingamThreshold simplification #124

Closed
wants to merge 2 commits into from

Conversation

albertyw
Copy link

@albertyw albertyw commented Mar 5, 2023

Currently the VisvalingamThreshold simplification allows polygons to be simplified to 2 points which, at 0 area, is likely not the intention of the user nor does it produce a polygon that follows the geojson standard (#45). This changes the default to 3 points minimum.

Visvalingam and VisvalingamKeep will still allow users to explicitly specify 0, 1, or 2 points minimum if actually desired.

@albertyw
Copy link
Author

albertyw commented Mar 5, 2023

Considering this more, I see that Visvalingam may be applied to LineStrings and other types which may have no expectation of a non-zero area or more than 2 unique points. Similar to the discussion in #45, perhaps that indicates there should be no minimum number of points (other than the minimum of 2 points being the organic result of applying the algorithm) and users may need to instead specify number of points explicitly. I'm no expert in geojson so I'd be happy to discuss approaches.

@paulmach
Copy link
Owner

this pr #140 updated "zero min points" to mean

  • 2 if a line, already the case
  • 3 for non-closed rings, rings/polygons, etc where the first point does not match the first, i.e. implicitly closed.
  • 4 for closed rings

I think that was the intention by this change.

@paulmach paulmach closed this Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants