Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacement for the geojsoncontour package needs to be found #952

Closed
jgriesfeller opened this issue Dec 4, 2023 · 7 comments
Closed

Replacement for the geojsoncontour package needs to be found #952

jgriesfeller opened this issue Dec 4, 2023 · 7 comments
Assignees
Labels
dependencies Issues related to pyaerocom dependencies

Comments

@jgriesfeller
Copy link
Member

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)

@lewisblake lewisblake added the dependencies Issues related to pyaerocom dependencies label Dec 4, 2023
@heikoklein
Copy link
Member

depends on: metno/pyaro-readers#27

@lewisblake lewisblake added this to the m2024-02 milestone Jan 26, 2024
@heikoklein heikoklein removed this from the m2024-02 milestone Jan 30, 2024
@heikoklein
Copy link
Member

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

@AugustinMortier
Copy link
Member

AugustinMortier commented Jun 5, 2024

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: matplotlib/matplotlib#27443

@heikoklein
Copy link
Member

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.

@lewisblake
Copy link
Member

@lewisblake
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Issues related to pyaerocom dependencies
Projects
None yet
Development

No branches or pull requests

4 participants