id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 828352998,MDExOlB1bGxSZXF1ZXN0NTkwMTcwNjM1,5021,GH5005 fix documentation on open_rasterio,30908904,closed,0,,,6,2021-03-10T21:24:02Z,2021-03-15T15:56:22Z,2021-03-15T15:56:21Z,CONTRIBUTOR,,0,pydata/xarray/pulls/5021," - [x] Closes #5005 - [ ] Addresses #3185 - [ ] Fixed an example line in the `open_rasterio` docstring that extracted an affine transform in an old way that no longer works. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5021/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 823418135,MDU6SXNzdWU4MjM0MTgxMzU=,5005,Example documentation in open_rasterio,30908904,closed,0,,,2,2021-03-05T21:08:19Z,2021-03-15T15:56:21Z,2021-03-15T15:56:21Z,CONTRIBUTOR,,,,"This is my first time submitting an issue, so sorry if doing this wrong. In the documentation for open_rasterio there's an example on how to generate 2D coordinates from a GeoTiff file using it: https://github.com/pydata/xarray/blob/37522e991a32ee3c0ad1a5ff8afe8e3eb1885550/xarray/backends/rasterio_.py#L177-L181 However, this method does not really work because the `da.attrs['transform']` attribute is not coded in the GDAL standard, but as `affine.Affine` expects directly (maybe it wasn't so in a previous version. So, at least for me (v0.16.2), getting the affine transformation right is done by simply replacing that line with the simpler: ` transform = Affine(*da.attrs['transform']) ` Again, sorry if this is not how this should be done, I just took a while to figure this out for my application and thought other people might benefit from it. If I can do something to fix it (if it's really broken) please let me know.","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5005/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue