Skip to main content

Vector data cubes for Xarray

In geospatial analysis, data cubes can be of two sorts. The first is a raster data cube, typically represented by an Xarray DataArray indexed either by x or y dimensions or latitude and longitude. The second is a vector data cube, which is an n-D array that has either at least one dimension indexed by a 2-D array of vector geometries (Pebesma, 2022) or contains geometries as variables (e.g. moving features or time-evolving shapes), possibly both.

We can distinguish between two types of geometries in a DataArray or Dataset:

  • coordinate geometry - an array (typically one dimensional) is used as coordinates along one or more dimensions. A typical example would be an outcome of zonal statistics of a multi-dimensional raster, avoiding the need for flattenning of the array to a data frame.
  • variable geometry - an array (typicially multi-dimensional) is used as a variable within a DataArray. This may encode evolving shapes of lava flows in time, trajectories, or growth of city limits.

The Xvec package brings support for both of these to the Xarray ecosystem. It uses Shapely package, allowing a seamless interface between Xvec and GeoPandas. See this post by Edzer Pebesma on an introduction of the concept of coordinate geometry or introduction page in Xvec documentation.

Project status

The project is in the early stage of development and its API may still change.

Installing

You can install Xvec from PyPI using pip or from conda-forge using mamba or conda:

pip install xvec

Or (recommended):

mamba install xvec -c conda-forge

Development version

The development version can be installed from GitHub.

pip install git+https://github.com/xarray-contrib/xvec.git

We recommend installing its dependencies using mamba or conda before.

mamba install xarray shapely pyproj -c conda-forge

Metadata

Release files for xvec 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xvec 0.5.2
File Size Uploaded
xvec-0.5.2.tar.gz 2.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for xvec 0.5.2
File Interpreter ABI Platform
xvec-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 MB

Release files / xvec-0.5.2.tar.gz

Download URL xvec-0.5.2.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
f62334066fa0a85a51732361170bb050ae9106ffababb6afbb2301a3f7ee9a04
BLAKE2b-256 checksum
How to use checksums
6d38d45c4bf760f3c46621631b48ae0af7583747022051bc318a51cb87a9ea75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / xvec-0.5.2-py3-none-any.whl

Download URL xvec-0.5.2-py3-none-any.whl
Size 784.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
757243b9ad8d66922111b16f51d157560cf11916fe790a20b9e955a44efb8e8d
BLAKE2b-256 checksum
How to use checksums
9eb4b3161f856c704938d69c10680abaaf4a24783fa58a9f95590f2a0b63dd09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page