Skip to content

Set minimum points for a VisvalingamThreshold simplification#124

Closed
albertyw wants to merge 2 commits intopaulmach:masterfrom
albertyw:min-to-keep
Closed

Set minimum points for a VisvalingamThreshold simplification#124
albertyw wants to merge 2 commits intopaulmach:masterfrom
albertyw:min-to-keep

Conversation

@albertyw
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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