-
Notifications
You must be signed in to change notification settings - Fork 86
Add geometry simplification option to polygonize() #1151
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
polygonize() exists but produces exact pixel-boundary polygons. On high-resolution rasters this creates extremely dense geometries with thousands of vertices per polygon, making the output impractical for downstream use (slow rendering, large file sizes, unwieldy for spatial joins).
Scope
- Add a
simplify_toleranceparameter topolygonize()that applies Douglas-Peucker simplification during or after polygon generation. Tolerance should be in the raster's coordinate units. - Optional: Visvalingam-Whyatt as an alternative simplification algorithm, which tends to produce better results for cartographic output.
- Topology preservation: adjacent polygons shouldn't develop gaps or overlaps after simplification. This is the hard part. A shared-edge approach (simplify edges rather than individual polygons) would handle it, or at minimum a flag to warn users when topology isn't guaranteed.
Why this matters
This matters most for land cover and classification outputs where polygonize() is used to create vector deliverables. The current workaround is GDAL's gdal_polygonize.py followed by ogr2ogr -simplify, which adds a GDAL dependency and an intermediate file. Having simplification built into polygonize() keeps the workflow self-contained.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request