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

reproject doens't reproject AutoDim dimensions #769

Open
tiemvanderdeure opened this issue Sep 28, 2024 · 3 comments
Open

reproject doens't reproject AutoDim dimensions #769

tiemvanderdeure opened this issue Sep 28, 2024 · 3 comments

Comments

@tiemvanderdeure
Copy link
Contributor

The dim field of a lookup doesn't inherit the supertype of the dimension (XDim, etc), but defaults to Rasters.AutoDim(). reproject dispatches on this field, So reproject will silently not do anything and return the same values - but with a different crs associated!

using Rasters
import Rasters: XDim
xdim = X(Projected(1:10; crs = EPSG(4326)))
xdim isa XDim # true
lookup(xdim).dim isa XDim # false
lookup(reproject(xdim; crs = EPSG(3857))).data == lookup(xdim).data # true!

I get that when reprojecting we want all dimensions that are not x or y to keep the same values, and this is not a problem after constructing a Raster using the dimension - but maybe there's a way to change the dispatch on the internal reproject methods so this doesn't happen?

@rafaqz
Copy link
Owner

rafaqz commented Sep 28, 2024

Arrg yes thats not cool. We should error on AutoDim. But if you format it first it should work?

@rafaqz
Copy link
Owner

rafaqz commented Sep 28, 2024

Also nothing that is not X or Y should get a crs...

@tiemvanderdeure
Copy link
Contributor Author

But if you format it first it should work?

Yes it does

Also nothing that is not X or Y should get a crs...

Looked at it again and this only affects Projected dimensions, and I don't think anything that is not X or Y is usually projected

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

No branches or pull requests

2 participants