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-211351199,https://api.github.com/repos/pydata/xarray/issues/790,211351199,MDEyOklzc3VlQ29tbWVudDIxMTM1MTE5OQ==,1151287,2016-04-18T12:06:07Z,2016-04-18T12:06:07Z,NONE,"@IamJeffG thanks for the example. I didn't realize you'd already been integrating xarray with rasterio already. Is that library open source?
> Reprojecting or clipping after reading xarray, like I do, goes against @perrygeo's recommendation. So maybe my example is moot, but I really like being able to do this programmatically in python, not CLI.
To clarify, I just want to make sure that clipping/reprojecting/resampling remains an explicit step. That's a great approach you outlined, I just wouldn't want any software to make those assumptions for me!
> 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. We've been doing more testing on this topic and found that rasterio _generally_ works as expected for positive-y rasters. But there are still some built-in [assumptions about negative-y rasters](https://github.com/mapbox/rasterio/issues/525#issuecomment-206368355) that cause spectacular failures. It's still a work in progress...
","{""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-198343073,https://api.github.com/repos/pydata/xarray/issues/790,198343073,MDEyOklzc3VlQ29tbWVudDE5ODM0MzA3Mw==,1151287,2016-03-18T12:57:14Z,2016-03-18T12:57:14Z,NONE,"@fmaussion @jhamman re: projecting coordinates to lat-lng.
If you consider the raster cells as independent points, you _can_ project them independently but they will likely not be regularly spaced. With few exceptions, _if you need to maintain a regular grid_, transforming data between projections will alter the shape of the array and require resampling (GDAL and rasterio call the process ""warping"" to reflect this). There are decisions and tradeoffs to be considered with the various resampling methods, selecting new extents and cell sizes, etc so it's typically not something you want to do on-the-fly for analyses.
I think keeping the xarray coordinates as generic cartesian x-y makes sense, at least initially. Even in many GIS tools, analysis is done on a naive 2D plane and it's assumed that the inputs are of the same projection. I'd recommend doing any reprojection outside of xarray as a pre-processing step (with e.g. [`gdalwarp`](http://www.gdal.org/gdalwarp.html) or [`rio warp`](https://github.com/mapbox/rasterio/blob/master/docs/cli.rst#warp)).
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,140063713