home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 344058811

This data as json

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
344058811 MDU6SXNzdWUzNDQwNTg4MTE= 2308 Proposal: Update rasterio backend to store CRS/nodata information in standard locations. 8699967 closed 0     10 2018-07-24T14:18:58Z 2018-10-09T12:46:54Z 2018-10-09T12:46:54Z CONTRIBUTOR      

Problem description

Currently the way data is stored in the dataaray when using xarray.open_rasterio the crs and nodata information is stored in an attributes. It would be nice to be able to have them stored in standard locations so that other tools (rasterio, QGIS, GDAL) can find the information properly after dumping to a file with to_netcdf().

Proposed solutions

The nodata should be loaded into _FillValue

I propose that the CRS information be stored using the CF spatial_ref convention as it is supported by the main open source GIS tools. To do so, you add the crs coordinate to the dataset/dataarray. And then, you add the spatial_ref attribute to the crs which is stored as a crs WKT string. Next, you add the grid_mapping attribute to all associated variables that contains the coordinate name crs as the grid_mapping.

Here is an example of how it would look on a dataset: <xarray.Dataset> Dimensions: (x: 65, y: 31) Coordinates: * x (x) float64 ... * y (y) float64 ... time datetime64[ns] ... crs int64 ... Data variables: ndvi (y, x) float64 ... Attributes: Here is how the crs or spatial_ref coodinate variable would look: <xarray.DataArray 'crs' ()> array(0) Coordinates: time datetime64[ns] ... crs int64 0 Attributes: spatial_ref: PROJCS["UTM Zone 15, Northern Hemisphere",GEOGCS["WGS 84",D... And here is how it would look on the variables: <xarray.DataArray 'ndvi' (y: 31, x: 65)> array([[ ...]]) Coordinates: * x (x) float64 ... * y (y) float64 ... time datetime64[ns] ... crs int64 0 Attributes: grid_mapping: crs

More information about this is in https://github.com/pydata/xarray/issues/2288.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2308/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 10 rows from issue in issue_comments
Powered by Datasette · Queries took 0.622ms · About: xarray-datasette