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

Replace use of deprecated collections with get_paths #27

Merged
merged 5 commits into from
Jan 6, 2025

Conversation

magnusuMET
Copy link
Contributor

Features are now created per contour-level instead of per-polygon.

For contour_to_geojson we now split the path into subpaths ourselves, but it should be rather straight forward.

For contourf_to_geojson there are some larger changes as one path is emitted per level. Here the contours are combined by checking the handedness of the polygons, and assuming the contours follows sensible conventions, i.e. the first CCW polygon is a ring and following CW polygons represents holes.

Benchmark files had to be updated to update level-index and the color which was off-by-one if I understand the code correctly.

continue
if np.all(np.equal(coordinates, coordinates[0])):
# Matplotlib sometimes emits empty paths which
# can be ignored
continue
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This continue would not increase contour_index which might have been a bug

Copy link
Collaborator

@jgriesfeller jgriesfeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I'm really able to understand the code since I'm not very familiar with the geojson format. But the code looks good and since we are using the library quite extensively, I assume we will find problems right away.

@lewisblake lewisblake merged commit e10f0cf into bartromgens:master Jan 6, 2025
@magnusuMET magnusuMET deleted the deprecated_collections branch January 6, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants