However the output of the GDAL script differs slightly from scikit-image's output when used on a raster with angled sides. Here are a few images to illustrate:
Before extracting contours, my source raster is first masked (via rasterio.mask.mask) with a rectangular polygon, producing something like this:
When I use
skimage.find_contours, it produces open contours (which is what I want) when the desired height disappears out of bounds, as in the bottom of the right edge below:
But when the mask is rotated, like this:
The contours produced by
skimage.find_contours now follow the edge of the raster when they pass out of bounds and are closed, as in the bottom-right corner.
(Contours produced by GDAL from the same raster are open in the same corner.)
I guess I could add a margin, then clip the contours to the correct bounds, but is there another way to deal with this situation?
(I'm open to alternatives to scikit-image, see my previous question here.)