Replacement for the geojsoncontour package needs to be found
The development of the geojsoncontour package has been abandoned. The last commit id from 5 November 2020. According to it's setup.py the last supported Python version is 3.7
We need to find a replacement or fork it (has MIT license)
Used for aeroval's contour plots (maps)
- Alternative approach https://github.com/matplotlib/matplotlib/issues/27443#issuecomment-1840542609
- @AugustinMortier's work around for CAMS2_35b https://gitlab.met.no/cams2_35b/scripts/-/blob/main/pyaeralert/utils.py?ref_type=heads
depends on: metno/pyaro-readers#27
A solution to this issue could be to convert the contours to shapely objects https://gis.stackexchange.com/questions/99917/converting-matplotlib-contour-objects-to-shapely-objects and then use shapely's geojson output https://shapely.readthedocs.io/en/stable/reference/shapely.to_geojson.html
You might want to have a look at the approach I took in the issue quoted in a previous comment. I believe this would be more efficient: it's using contourpy (instead of matplotlib) and shapely. This was written for predefined layers, so the main thing here would be to generate the layers automatically based on range values given for specific parameters.
The contourpy approach was recommended by matplotlib people: https://github.com/matplotlib/matplotlib/issues/27443
contourpy might be worth a look, but it is a external one-man dependency. In addition, contourpy does not handle colors, so information about colors of the different ranges needs to be added, and conversion to geojson (which is the topic of this issue) is still left to another library shapely.
https://github.com/bartromgens/geojsoncontour/issues/25
@jgriesfeller and I have been added as maintainers for geojsoncontour and can contribute to it's development for this project. A replacement is no longer necessary.