Open AugustinMortier opened 11 months ago
https://pypi.org/project/geojson-rewind/ seems to be able to rewind geojson polygons. Could be used to fix this, or provide tips on how to fix this.
When using geojsoncontour.contour_to_geojson
on contours created by plt.contour
from matplotlib>=3.8.0, different isolines (with same values) were connected together for my usecase:
After downgrading to matplotlib==3.7.3, the output from geojsoncontour.contour_to_geojson
is normal again:
They are some breaking changes concerning contourf method in the 3.8 release of matplotlib https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.8.0.html#contourset-is-now-a-single-collection
When using
geojsoncontour.contour_to_geojson
on contours created byplt.contour
from matplotlib>=3.8.0, different isolines (with same values) were connected together for my usecase:After downgrading to matplotlib==3.7.3, the output from
geojsoncontour.contour_to_geojson
is normal again:
I made a fix for it, here is my PR #26
Matplotlib still allows you to have an access to each closed contour in contour.allsegs
field, while contour.get_paths()
contains a single Path for each level. I understand, there is a room for improvement, maybe it's better to get only one feature for every level instead of one feature for each closed contour.
Hello from Norway ! It looks like, since matplotlib 3.8.?, the geojson files computed with geojsoncontour are not always following the right-hand rule. This was probably taken care of by matplotlib before, but recent release notes suggest some "revert contour" deprecation.