home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

1 row where user = 26328973 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date), closed_at (date)

type 1

  • issue 1

state 1

  • closed 1

repo 1

  • xarray 1
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
1282651087 I_kwDOAMm_X85Mc7PP 6718 Losing CRS when interpolating r3v1 26328973 closed 0     2 2022-06-23T16:17:21Z 2022-07-08T08:22:53Z 2022-07-08T08:22:52Z NONE      

What happened?

Hi, I'm not very sure if this issue belongs here, but I found a little bug/feature although it may be intentional.

Having a Dataset with geographic information, calling ds.rio.set_crs() sets de CRS. Everything is okay. But then, when manipulating again that object (doing some interpolation for example), it loses the CRS information previously attached.

May be I missunderstood CRS or interp, just to let you know.

Also, I don't know if this behaviour is repeated with other transformations.

What did you expect to happen?

I expect to mantain the same CRS as the original one.

Minimal Complete Verifiable Example

```Python import xarray as xr
import rioxarray
import numpy as np

ds = xr.tutorial.load_dataset("air_temperature")

Check CRS

assert ds.rio.crs == None

Set CRS

ds.rio.set_crs("EPSG:4326", inplace=True)
print(ds.rio.crs) # EPSG:4326
assert ds.rio.crs == "EPSG:4326"

ds_ = ds.interp(lat=np.linspace(30, 20, 10), lon=np.linspace(200, 210, 10))

assert ds_.rio.crs == "EPSG:4326" # <---- Shouldn't it be EPSG:4326? ```

MVCE confirmation

  • [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [X] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [X] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

No response

Environment

>>> xr.show_versions() /usr/lib/python3.10/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") INSTALLED VERSIONS ------------------ commit: None python: 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] python-bits: 64 OS: Linux OS-release: 5.18.5-arch1-1 machine: x86_64 processor: byteorder: little LC_ALL: None LANG: es_ES.UTF-8 LOCALE: ('es_ES', 'UTF-8') libhdf5: 1.12.2 libnetcdf: None xarray: 2022.3.0 pandas: 1.4.2 numpy: 1.22.4 scipy: 1.8.1 netCDF4: None pydap: None h5netcdf: None h5py: 3.7.0 Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: 1.3a3 cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: 3.5.2 cartopy: 0.20.2 seaborn: None numbagg: None fsspec: None cupy: None pint: None sparse: None setuptools: 61.3.1 pip: 21.0 conda: None pytest: 7.1.2 IPython: 8.4.0 sphinx: None rioxarray-0.11.1
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6718/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 19.947ms · About: xarray-datasette