v0.41.0
Improve polygon algorithms.
Features
- Rewrite the
polygon
module to run computation with opencv in place of scikit-image for finding contours. This change improves the algorithm runtime and fixes some previous unstable behavior in finding nested contours. For an introduction to the methodology, see the OpenCV contour tutorial.
Breaking changes
- Completely rewrite the
polygon
module. Replace the "main" public functionpolygon.find_contours_to_depth
withpolygon.find_multipolygon
. Replace thepolygon.contour_to_lat_lon
function withpolygon.multipolygon_to_geojson
. Returnshapely
objects when convenient to do so. - Convert continuous data to binary for polygon computation.
- Remove parameters
min_area_to_iterate
anddepth
in theMetDataArray.to_polygon_feature
method. Thedepth
parameter has been replaced by the booleaninteriors
parameter. Add aproperties
parameter for adding properties to thePolygon
andMultiPolygon
features. Themax_area
andepsilon
parameters are now expressed in terms of latitude-longitude degrees.
Internals
- Add
opencv-python-headless>=4.5
as an optional "vis" dependency. Some flavor ofopencv
is required for the updated polygon algorithms.