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

Add support for xarray objects #133

Open
darribas opened this issue Feb 1, 2021 · 2 comments
Open

Add support for xarray objects #133

darribas opened this issue Feb 1, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@darribas
Copy link
Member

darribas commented Feb 1, 2021

Opening up the discussion here to see whether it'd make sense and if so how. Would you @knaaptime be open to explore support for xarray objects instead of paths on disk for rasters?

Taken from #130 :

One more general question I got as I was re-reading your code: why do you tie the raster to a file? I'm thinking the same way we take GeoDataFrame objects instead of shapefile paths, would you consider taking DataArray objects? From a user perspective, I could see myself wanting to do some pre-processing on the raster before feeding it to extract_raster_features (for example combining different values into a binary mask, or compute an index with a threshold for the mask). More generally, it'd decouple analysis from disk objects, so you could use this right away from a file read over the web (although it's true rasterio takes remote paths...). Just a thought and not necessarily for this PR but, if of interest, I'd open an issue to track progress on it...

I think if this is of interest, we could use this issue to centralise discussion about what that'd look like and then try to split it into smaller pieces we can start accomplishing. I think for the project @martinfleis and I are working on, this would be a very nice feature to have since our file on disk is a .vrt that points to many files, etc. Being able to pre-process as we want that before passing to tobler would be a big plus.

@darribas darribas added the enhancement New feature or request label Feb 1, 2021
@knaaptime
Copy link
Member

definitely! :)

@knaaptime
Copy link
Member

xref, I wanted to add an example using https://easystac.readthedocs.io/en/latest/ which has super high resolution imagery and uses xarray as their data structure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants