Skip to content

Update to calliope v0.7.0dev5 #17

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

Merged
merged 2 commits into from
Mar 4, 2025
Merged

Update to calliope v0.7.0dev5 #17

merged 2 commits into from
Mar 4, 2025

Conversation

brynpickering
Copy link
Member

Closes #12
Fixes #11

Update to latest dev version of Calliope v0.7.

Copy link
Member

@sjpfenninger sjpfenninger left a comment

Choose a reason for hiding this comment

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

Can you at least give a one-liner description of the changes in geo.py, i.e. get_geo_data? This seems to go beyond fixing #12?

@@ -9,8 +11,8 @@
from calligraph.core import filter_selectors

# Transform from Web Mercator to Lat/Lon
MERCATOR_TO_LATLON = Transformer.from_crs("EPSG:3857", "EPSG:4326")
LATLON_TO_MERCATOR = Transformer.from_crs("EPSG:4326", "EPSG:3857")
MERCATOR_TO_LATLON = Transformer.from_crs("EPSG:3857", "EPSG:4326", always_xy=True)
Copy link
Member

Choose a reason for hiding this comment

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

This isn't used, so better to remove it until it's actually needed:

Suggested change
MERCATOR_TO_LATLON = Transformer.from_crs("EPSG:3857", "EPSG:4326", always_xy=True)

MERCATOR_TO_LATLON = Transformer.from_crs("EPSG:3857", "EPSG:4326")
LATLON_TO_MERCATOR = Transformer.from_crs("EPSG:4326", "EPSG:3857")
MERCATOR_TO_LATLON = Transformer.from_crs("EPSG:3857", "EPSG:4326", always_xy=True)
LONLAT_TO_MERCATOR = Transformer.from_crs("EPSG:4326", "EPSG:3857", always_xy=True)
Copy link
Member

Choose a reason for hiding this comment

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

Why this change from LATLON to LONLAT? Is there an issue with the code as it stands?

Copy link
Member Author

Choose a reason for hiding this comment

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

LON -> x and LAT -> y, so you convert (lon, lat) to (x,y)and vice versa. Should be MERCATOR_TO_LONLAT too, actually.

This was causing an issue because it was doing (lat, lon) to (x, y) which geopandas/proj was getting confused by. I'll need to remind myself exactly how, it was 2 months ago. Should have left a comment ;)

@brynpickering brynpickering merged commit 6e9989c into main Mar 4, 2025
@brynpickering brynpickering deleted the update-calliope branch March 4, 2025 10:07
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.

KeyError 'applied_additional_math' when using latest calliope
2 participants