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

rioxarray #7

Closed
snowman2 opened this issue Apr 16, 2019 · 6 comments
Closed

rioxarray #7

snowman2 opened this issue Apr 16, 2019 · 6 comments

Comments

@snowman2
Copy link
Collaborator

https://github.com/corteva/rioxarray

It would be great to have both projects collaborate!

@djhoese
Copy link
Contributor

djhoese commented Apr 16, 2019

What is the scope of that project? I would have gladly given you collaborator on this project to avoid having two. Maybe rasterio is a big enough dependence that geoxarray will be the basic functionality depending on pyproj's CRS object for coordinates and rioxarray would provide additional functionality only available in rasterio. We have some similar functionality in Satpy but not as an xarray accessor.

Side note: How would you feel about clip -> crop since clip currently has a numeric meaning in numpy and xarray?

@snowman2
Copy link
Collaborator Author

snowman2 commented Apr 16, 2019

What is the scope of that project?

It is specifically for rasterio-like functionality.

I would have gladly given you collaborator on this project to avoid having two.

I was thinking having the rasterio functionality in its own extension could simplify things for geoxarray. (i.e. It could be an optional engine for geoxarray). Then, you could potentially have an engine for pyresample etc ... Either way, it can help further the discussion :).

Also, happy to be a collaborator for this project.

How would you feel about clip -> crop since clip currently has a numeric meaning in numpy and xarray?

No specific preference on my end.

@yxdragon
Copy link

hi, a light and smart work! I also want to have a tool for geo image, (light and esay to install, only support crs and transform mat). xarray accessor is a good idea.

I did not find a solution befor, and I did not want depend on rasterio, for I think it is heavy and not very pythonic. So I build a project similar, I subclass the ndarray object. GeoNumpy

  1. add crs and mat
  2. treat the transform mat smartly when slicing or crop.
  3. add project and invprj method to trans coordinates numpy array from pix to world

and we can do image reproject/merge/rasample easily by scipy.ndimage.interpolation.map_coordinate. match.

@djhoese
Copy link
Contributor

djhoese commented Sep 16, 2019

@yxdragon Interesting idea. Rasterio may be heavy, but it also is very powerful. It depends what you are doing with your data.

One issue I would have in adopting GeoNumpy in my own work is that it will be difficult to use with dask and xarray since it is a subclass.

I work on the Satpy (https://satpy.readthedocs.io/en/latest/) project which uses xarray DataArray objects backed by dask arrays to get good perform. We typically deal with a lot of data and have had trouble getting good performance out of scipy's interpolation methods in the past so we use our pyresample library which uses pykdtree for nearest neighbor resampling a long with a couple other resampling algorithms.

Thanks for the info. Cool project.

@yxdragon
Copy link

@djhoese "trouble getting good performance out of scipy's interpolation methods"
I also care performance very much. My experience is numpy, scipy, scikit-image is slow (about 1/10 performence of the opencv or C), but in wrong usage, it will be several times slower.

  1. scipy.affine_transform, geometry_transform is not flexible, for it only do a warp rectangle, but map_coordinate is OK, we can got any pix we want.

  2. another cost is the geo projection. I do the projecton every n rows and cols, then use a bilinear interpolation to get the dense points between. then use these dense points to map_coordinates.

  3. I saw satpy can do other reampling, if it is not a simple nearest or bilinear sampleing, I may got the dense points, but befor map_coordinates, do a convolve with a mask. (skimage, opencv support mask, means only count the given region)

I care the performance very much too. If you are intrested in, you can share a geo image and do a resampleing with satpy (a simple neareast, and a gaussian one), I want to implement it in scipy, and have a look the differance! (I am sorry, my english is bad, with many mistake)

@djhoese
Copy link
Contributor

djhoese commented Jul 17, 2023

I'm going to close this issue. #24 covered a few newer cases of differences between the projects, but at this point Alan and I are both very aware of rioxarray/geoxarray. Each feature or interface change in geoxarray will likely require at least a second thought on how it affects rioxarray. I know that and I'll try to keep those concerns reflected in future issues and PRs.

@djhoese djhoese closed this as completed Jul 17, 2023
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

3 participants