home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 341331807

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
341331807 MDU6SXNzdWUzNDEzMzE4MDc= 2288 Add CRS/projection information to xarray objects 1828519 open 0     45 2018-07-15T16:02:55Z 2022-10-14T20:27:26Z   CONTRIBUTOR      

Problem description

This issue is to start the discussion for a feature that would be helpful to a lot of people. It may not necessarily be best to put it in xarray, but let's figure that out. I'll try to describe things below to the best of my knowledge. I'm typically thinking of raster/image data when it comes to this stuff, but it could probably be used for GIS-like point data.

Geographic data can be projected (uniform grid) or unprojected (nonuniform). Unprojected data typically has longitude and latitude values specified per-pixel. I don't think I've ever seen non-uniform data in a projected space. Projected data can be specified by a CRS (PROJ.4), a number of pixels (shape), and extents/bbox in CRS units (xmin, ymin, xmax, ymax). This could also be specified in different ways like origin (X, Y) and pixel size. Seeing as xarray already computes all coords data it makes sense for extents and array shape to be used. With this information provided in an xarray object any library could check for these properties and know where to place the data on a map.

So the question is: Should these properties be standardized in xarray Dataset/DataArray objects and how?

Related libraries and developers

  • pyresample (me, @mraspaud, @pnuu)
  • verde and gmt-python (@leouieda)
  • metpy (@dopplershift)
  • geo-xarray (@andrewdhicks)
  • rasterio
  • cartopy

I know @WeatherGod also showed interest on gitter.

Complications and things to consider

  1. Other related coordinate systems like ECEF where coordinates are specified in three dimensions (X, Y, Z). Very useful for calculations like nearest neighbor of lon/lat points or for comparisons between two projected coordinate systems.
  2. Specifying what coords arrays are the CRS coordinates or geographic coordinates in general.
  3. If xarray should include these properties, where is the line drawn for what functionality xarray supports? Resampling/gridding, etc?
  4. How is the CRS object represented? PROJ.4 string, PROJ.4 dict, existing libraries CRS object, new CRS object, pyproj.Proj object?
  5. Affine versus geotransforms instead of extents: https://github.com/mapbox/rasterio/blob/master/docs/topics/migrating-to-v1.rst#affineaffine-vs-gdal-style-geotransforms
  6. Similar to 4, I never mentioned "rotation" parameters which some users may want and are specified in the affine/geotransform.
  7. Dynamically generated extents/affine objects so that slicing operations don't have to be handled specially.
  8. Center of pixel coordinates versus outer edge of pixel coordinates.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2288/reactions",
    "total_count": 14,
    "+1": 14,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

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