-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[DNM] GeoTransformIndex prototype #10055
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Benoit Bovy <benbovy@gmail.com>
I don't understand this, the (implicit) coords are in metres, but this idiomatically seems to imply a change of crs to longlat: there's no sense to setting options to longlat here afaics?? surely sel() is about the native coordinates? Obviously we can change coordinate system for the data, but why? Change the query. What am I missing |
Great to see you experimenting with coordinate transforms @dcherian! A few comments (I've had a quick look at the code and notebook but didn't play with it yet):
Your Not sure exactly what you mean by "skip applying isel", but if you mean do not create a new GeoTransformIndex then
The main idea of xproj is to keep the spatial reference coordinate (with its CRSIndex) separate from other crs-aware indexed coordinates (here "x" and "y"), so we can reuse it with different kinds for geo-referenced data (raster, vector, irregular mesh, point cloud, etc.). For this reason I think it is better not to associate a spatial reference coordinate with GeoTransformIndex. What we need here essentially is to export the affine parameters as a
I think here the See discussion in #7099 for passing arbitrary options to |
I'm not sure to see the 3 new GeoTransformIndex objects in the example notebook? What I see through the repr of the dataset is the |
I could reproduce this. It is a regression introduced in #9002. Bypassing the fastpath isel indexes method brings back the expected behavior (a unique index for each of its associated coordinates). EDIT: opened #10063 |
The So I don't think this is a good idea. Seems like |
I don't think either that we need or should remove attributes on the spatial reference coordinate. Associating it with an xproj.CRSIndex and somehow ensuring the geotransform metadata is kept in-sync doesn't seem incompatible to me (although probably not ideal admittedly). |
yet another attempt to build CRS-aware indexing on top of #9543.
Here is an example notebook using @mdsumner's example data from #9543
I'm opening this here for visibility, and because there's clearly much to do inside Xarray before this can be fully built out someplace else.
Some features:
GeoTransform
attribute, so we track both CRS and extents.isel
with slices and creates a new GeoTransform for the result. This means the index needs to track thespatial_ref
or "grid mapping" variable. Not sure how this will interface withxproj
.sel
withcrs
specified and transforms to the data's CRS for indexing.Major comments:
.sel
broke after I added.isel
! I don't fully understand this but we'll need to figure out some way to skip applyingisel
?newds.isel(x=slice(None, None, 2), y=slice(None, None, 2))
creates 3 new GeoTransformIndex objects. I don't understand this..sel
to allow the user to pass a CRS for their query down to the index. The second comment does this is a hacky manner.Other comments:
cc @maxrjones @benbovy