html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/790#issuecomment-211109010,https://api.github.com/repos/pydata/xarray/issues/790,211109010,MDEyOklzc3VlQ29tbWVudDIxMTEwOTAxMA==,2443309,2016-04-17T20:34:31Z,2016-04-17T20:34:31Z,MEMBER,"Thanks for the comments @IamJeffG. I haven't had any time recently to mess around with this so I haven't made any progress since the original notebook.
> It's not good to assume a negative y-step size. Rarely, I will come across a dataset that breaks convention with a positive y coordinate, meaning the first pixel is the lower-left corner, but at least the dataset is self-consistent. Rasterio works beautifully even with these black sheep, so we don't want an xarray reader to force the assumption.
Agreed. My notebook was just a quick example of how this could work and it would certainly benefit from some generalization when applying this as an xarray backend.
> In a past life I made side library that wraps rasterio's API to take and return xarray.DataArrays. It provides IO/clip/warp/rasterize operations on DataArrays, which themselves are annotated with the CRS and affine transforms as attributes.
Interesting. Any chance that's available for public viewing?
> Even if xarray's new rasterio backend only provides a reader ...
I only want to expose the reader and the necessary metadata to use the georeferenced dataset. Warping and other projection transformations would need to be handled downstream.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,140063713
https://github.com/pydata/xarray/issues/790#issuecomment-198474766,https://api.github.com/repos/pydata/xarray/issues/790,198474766,MDEyOklzc3VlQ29tbWVudDE5ODQ3NDc2Ng==,2443309,2016-03-18T18:04:52Z,2016-03-18T18:04:52Z,MEMBER,"@shoyer - that's what I was thinking too. In fact, that's more or less what I did in this example, although this is a eager implementation: https://anaconda.org/jhamman/rasterio_to_xarray/notebook
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,140063713
https://github.com/pydata/xarray/issues/790#issuecomment-197939841,https://api.github.com/repos/pydata/xarray/issues/790,197939841,MDEyOklzc3VlQ29tbWVudDE5NzkzOTg0MQ==,2443309,2016-03-17T15:44:48Z,2016-03-17T15:44:48Z,MEMBER,"As for 1) I'm open to having more discussion on decoding the coordinates. My contention here is that are useful, even in their unstructured format, since it permits visualization out of the box. I'll ping @perrygeo for more on this.
2) I don't really want to get into this because there isn't a standard treatment in geotiffs so it would, at best, be a guess on our end.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,140063713
https://github.com/pydata/xarray/issues/790#issuecomment-197573068,https://api.github.com/repos/pydata/xarray/issues/790,197573068,MDEyOklzc3VlQ29tbWVudDE5NzU3MzA2OA==,2443309,2016-03-16T22:05:34Z,2016-03-16T22:05:34Z,MEMBER,"@fmaussion - Here's an example of the basic functionality I'm thinking of implementing: https://anaconda.org/jhamman/rasterio_to_xarray/notebook
A things to think about:
1. I've given each array the `raster` name. Does that make since? This allows us to return a `Dataset` instead of a `DataArray`.
2. Which attributes do we want to copy over from the rasterio dataset? It is not entirely clear which attributes in the `rasterio._io.RasterReader` object should become `attrs`.
3. I have not implemented lazy or windowed reading yet but it should be pretty straightforward using the `window` argument to `src.read()`.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,140063713
https://github.com/pydata/xarray/issues/790#issuecomment-196021945,https://api.github.com/repos/pydata/xarray/issues/790,196021945,MDEyOklzc3VlQ29tbWVudDE5NjAyMTk0NQ==,2443309,2016-03-13T19:06:03Z,2016-03-13T19:06:03Z,MEMBER,"@fmaussion -
As for (1), I like your idea of leaving out the projection of the coordinates. That certainly makes things easier from the perspective of the backend.
A `band` dimension in (2) seems pretty manageable.
I'm not concerned about the GDAL dependency (3). I would love to see more robust conda support for GDAL but that's another issue. This would be an optional backend, similar to Pynio, which isn't broadly available on conda. We could sort out the CI issues.
So, if we took the simplest approach for implementing a `rasterio` backend, `open_dataset` would always return a `Dataset` with a single unprojected `DataArray` (name to be determined). The other big question is what to call the dimensions, since that is not explicitly provided in all raster formats.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,140063713
https://github.com/pydata/xarray/issues/790#issuecomment-195676319,https://api.github.com/repos/pydata/xarray/issues/790,195676319,MDEyOklzc3VlQ29tbWVudDE5NTY3NjMxOQ==,2443309,2016-03-12T07:01:12Z,2016-03-12T07:01:12Z,MEMBER,"Thanks @fmaussion. This was a helpful illustration of how this could be done. The `salem` `GeoTiff` and `Grid` objects include all and more than I was hoping to implement in xarray. However, after a bit more looking into this, I have mixed feelings about whether this would work in `xarray`. A brief summary of the pros/cons as I see them now.
Pros:
- Rasterio supports a wide range of raster formats (e.g. GeoTiff, ArcInfo ASCII Grid, etc.)
- Combined with `pyproj`, coordinate variables can be inferred
- Supports windowed reading (and writing), this would fit in well with the chunking approach already taken by `xarray`.
- Supports lazy loading of array values, this would fit in well with the loading policies of the other `xarray` backends.
Cons:
- Would require `xarray` to adopt conventions for projecting arrays, naming (coordinates, dimensions, arrays), and handling of raster attributes. I can image ways this could be done but it may take us in down a path we don't want to go.
- The `xarray` backends generally return `Dataset`s, however, `rasterio` returns individual arrays that would better be applied to `DataArray`s.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,140063713