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

Nuth & Kaab coregistration does not work in EPSG4326 #326

Closed
adehecq opened this issue Oct 21, 2022 · 5 comments
Closed

Nuth & Kaab coregistration does not work in EPSG4326 #326

adehecq opened this issue Oct 21, 2022 · 5 comments
Labels
bug Something isn't working priority Needs to be fixed rapidly

Comments

@adehecq
Copy link
Member

adehecq commented Oct 21, 2022

If DEMs are on a non-projected CRS, the Nuth & Kaab coregistration won't work, because the slope calculation does not make sense.
We can try to find a fix to that, or at least raise an Error when the input DEMs are in non-projected CRS.
I don't have time to write a reproducible example, but probably the Nuth & Kaab example with the DEMs reprojected in EPSG 4326 should reproduce that error.

@adehecq adehecq added the bug Something isn't working label Oct 21, 2022
@rhugonnet
Copy link
Contributor

Generically, we could have a UserWarning like they do in geopandas or rasterio:
Attempting to perform this operation in a geographic projection system, the results might be erroneous

For convenience "head" functions for which it is practical to have everything working in one-line, we could force the reprojection to a metric projection system and also raise a warning that this is done in the background.

@erikmannerfelt
Copy link
Contributor

Generically, we could have a UserWarning like they do in geopandas or rasterio: Attempting to perform this operation in a geographic projection system, the results might be erroneous

For convenience "head" functions for which it is practical to have everything working in one-line, we could force the reprojection to a metric projection system and also raise a warning that this is done in the background.

That's a super good idea. Any raster where xres != yres technically risk being a bit wonky.

I'm pretty sure that's what makes co-registration fail in WGS84 cases, not necessarily the degree coordinates. Sure, the units will be super off, but when xres == yres it should be consistent, no?

@rhugonnet rhugonnet added the priority Needs to be fixed rapidly label Aug 1, 2023
@erikmannerfelt
Copy link
Contributor

There's also the pyproj.CRS.is_projected property that might be useful in showing if it's a good or bad idea.

@adehecq
Copy link
Member Author

adehecq commented Sep 6, 2023

But... I added a NotImplementedError already some time ago here.
Is this sufficient (and so we close that issue) or do we want to implement that weird case?! I don't know why I didn't reference this issue when I made the change, my bad 🤦‍♂️

@rhugonnet
Copy link
Contributor

Indeed this is already covered by the NotImplementedError. Maybe we could generalize this type of error for other classes as well. But for this specific issue, we can close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority Needs to be fixed rapidly
Projects
None yet
Development

No branches or pull requests

3 participants