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

grass.jupyter: fix bbox reprojection for InteractiveMap #2501

Merged
merged 4 commits into from
Jul 28, 2022

Conversation

petrasovaa
Copy link
Contributor

Region in pseudo mercator tmp location could be smaller than it was supposed to because only 2 corners of the region were reprojected. Now it reprojects all 4 corners and gets maximum bbox from them.

@petrasovaa petrasovaa added this to the 8.2.1 milestone Jul 26, 2022
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

The computation look good.

The failing pytest needs an update. The original function was returning strings, but the new one returns float which is better, more expected behavior. If needed, use pytest.approx.

python/grass/jupyter/utils.py Outdated Show resolved Hide resolved
python/grass/jupyter/utils.py Outdated Show resolved Hide resolved
python/grass/jupyter/utils.py Outdated Show resolved Hide resolved
python/grass/jupyter/utils.py Outdated Show resolved Hide resolved
@@ -47,8 +45,12 @@ def reproject_region(region, from_proj, to_proj):
:return dict region: reprojected region as a dictionary with long key names
"""
region = region.copy()
# reproject all corners, otherwise reproj. region may be underestimated
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to mention here the complete v.in.region based solution from r.import?

@wenzeslaus wenzeslaus added Python Related code is in Python bug Something isn't working labels Jul 26, 2022
@petrasovaa petrasovaa merged commit 8457b90 into OSGeo:main Jul 28, 2022
@petrasovaa petrasovaa deleted the fix-bbox-reprojection branch July 28, 2022 19:56
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants