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

Change xy2ij behaviour to consider AREA_OR_POINT attribute as interpretation #348

Merged
merged 17 commits into from
Feb 9, 2023

Conversation

rhugonnet
Copy link
Member

@rhugonnet rhugonnet commented Feb 3, 2023

This PR changes xy2ij so that it never shifts the coordinates of pixels based on self.tags['AREA_OR_POINT'] by default. Now, ij2xy and xy2ij are reversible.

Shifting with the interpretation of self.tags['AREA_OR_POINT'] remains a possibility however (as it could be needed during interpolation of points, for instance), and is performed by setting the shift_area_or_pixel as True (which then reads the attribute from self.tags).

Some tests added also.

Resolves #341

Copy link
Member

@adehecq adehecq 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 also add a test to check that xy2ij and ij2xy are reversible, like in the issue raised?

@rhugonnet
Copy link
Member Author

Done!

@rhugonnet rhugonnet merged commit 823fff2 into GlacioHack:main Feb 9, 2023
@rhugonnet rhugonnet deleted the fix_xy2ij branch February 9, 2023 23: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.

A suspicious bug on raster.xy2ij
2 participants