home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 303327051

This data as json

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/pull/1260#issuecomment-303327051 https://api.github.com/repos/pydata/xarray/issues/1260 303327051 MDEyOklzc3VlQ29tbWVudDMwMzMyNzA1MQ== 10050469 2017-05-23T08:23:59Z 2017-05-23T08:23:59Z MEMBER

@shoyer @gidden tjhanks for testing, this is very useful.

Indeed rasterio uses a dict-like mapping for the PROJ4 strings (source: rasterio docs). This isn't a big deal since it provides the to_string() and from_string() methods which allow the do the round-trip.

I personally never noted the difference because pyproj (the python interface to the PROJ.4 library) can handle both representations:

``` In [1]: import xarray as xr

In [2]: ds = xr.open_rasterio('RGB.byte.tif')

In [3]: ds.crs Out[3]: CRS({'init': 'epsg:32618'})

In [4]: import pyproj

In [5]: pyproj.Proj(ds.crs) Out[5]: <pyproj.Proj at 0x7f12317c0468>

In [6]: pyproj.Proj(ds.crs.to_string()) Out[6]: <pyproj.Proj at 0x7f12317c0408> ```

My suggestion here (to avoid the serialisation problems you mention @gidden ) is to convert the CRS object to a string at read time

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  206905158
Powered by Datasette · Queries took 3.44ms · About: xarray-datasette