Skip to main content

GIS utility package

Project description

pyramids — GIS utilities for rasters, vectors & datacubes, built on GDAL/OGR

Documentations Python Versions License: GPL v3 pre-commit GitHub last commit GitHub Repo stars codecov Codacy Badge

GitHub commits since latest release (by SemVer including pre-releases)

pages-build-deployment

Current release info

Name Downloads Version Platforms
Conda Recipe Conda Downloads Downloads Downloads Downloads PyPI - Downloads Conda Version PyPI version Conda Platforms

conda-forge feedstock

Conda-forge feedstock

pyramids - GIS utility package

pyramids is a GIS utility package built on top of GDAL/OGR for working with raster data (GeoTIFF, NetCDF), vector data (shapefiles, GeoJSON), and multi-temporal datacubes.

pyramids at a glance — every GDAL format, none of the boilerplate

pyramids-gis is licensed under GPLv3 (see LICENSE.md). The platform wheels published on PyPI bundle GDAL and its native dependencies (PROJ, GEOS, libtiff, NetCDF-C, HDF5, libcurl, …) — each under its own MIT, BSD, LGPL, or Apache license. The full attribution list and shipped license texts are documented in THIRD_PARTY_LICENSES.md; if you use pyramids-gis in publications please also cite GDAL itself per gdal.org/cite_gdal.html.

graph LR
    GeoTIFF & NetCDF & Shapefile & UGRID -->|read| pyramids
    subgraph pyramids
        direction TB
        Dataset
        NetCDF_class[NetCDF]
        UgridDataset
        DatasetCollection
        FeatureCollection
        subgraph Engines["Dataset engines (ds.io · ds.spatial · ds.bands · ds.analysis · ds.cell · ds.vectorize · ds.cog)"]
        end
        subgraph Plotting["Plotting layer — _plot_helpers.render_array · mesh_render · NetCDFPlot · Selectors / ColourOpts / FacetSpec · basemap"]
        end
    end
    Dataset -->|crop · reproject · align| Dataset
    Dataset --- Engines
    FeatureCollection -->|rasterize| Dataset
    UgridDataset -->|interpolate| Dataset
    Dataset -->|vectorize| FeatureCollection
    DatasetCollection -->|lazy temporal stack| Dataset
    NetCDF_class -->|extends| Dataset
    Dataset & NetCDF_class & DatasetCollection & UgridDataset -->|plot| Plotting
    Plotting -->|delegates| cleopatra(["cleopatra<br/>ArrayGlyph · MeshGlyph · tiles"])

For the class relationships, internal layers, and detailed architecture diagrams, see docs/overview/architecture.md.

Main Features

  • Dataset - Read, write, crop, reproject, and align single-band and multi-band rasters (GeoTIFF) with full no-data handling and coordinate reference system support. Public API is organized into seven engine collaborators (ds.io, ds.spatial, ds.bands, ds.analysis, ds.cell, ds.vectorize, ds.cog); same-named facade methods on the Dataset itself keep the short form working — ds.crop(mask) and ds.spatial.crop(mask) are equivalent.
  • NetCDF - Extends Dataset for NetCDF files with time/variable dimensions and CF conventions metadata. Optional xarray interoperability. NetCDF.plot exposes an xarray-aligned plotting API (variable= + grouped Selectors / ColourOpts / FacetSpec dataclasses, curvilinear coords=, kind=, animate=, lazy chunks=).
  • UgridDataset - Read and visualize UGRID-1.0 unstructured meshes (triangles, quads, mixed). Supports mesh-to-raster interpolation and mesh-to-vector export.
  • DatasetCollection - Manage time-series of co-registered rasters as a lazy temporal stack (per-timestep gdal handles open on demand; the full cube is never materialised in RAM) with optional dask-backed reductions and groupby.
  • FeatureCollection - Work with vector data (shapefiles, GeoJSON) through a unified GeoDataFrame and OGR DataSource interface, including rasterization and geometry operations.
  • Plotting - Dataset / NetCDF / DatasetCollection / UgridDataset all expose a plot method backed by cleopatra (the [viz] extra), routed through a shared pyramids.dataset._plot_helpers core. Optional web-tile basemap underlays via pyramids.basemap.add_basemap (a thin wrapper over cleopatra.tiles.add_tiles).
  • Cloud-Optimized GeoTIFF (COG) - First-class read/write/validate support via ds.to_cog, ds.is_cog, and ds.validate_cog.
  • Spatial operations - Align rasters to a reference grid, reproject between coordinate systems, crop to vector boundaries, and convert between raster, NetCDF, and vector formats.

Installing pyramids

Installing pyramids from the conda-forge channel can be achieved by:

conda install -c conda-forge pyramids

It is possible to list all the versions of pyramids available on your platform with:

conda search pyramids --channel conda-forge

Install from GitHub (development)

To install the latest development version, you can install the library from GitHub:

pip install git+https://github.com/serapeum-org/pyramids

Note: installing from GitHub uses the sdist and requires a pre-installed system GDAL. See the full installation guide and troubleshooting for details.

pip

To install the latest release from PyPI:

pip install pyramids-gis

Optional extras

pip install pyramids-gis[viz]      # cleopatra plotting support
pip install xarray                 # to_xarray / from_xarray / to_netcdf interop (peer dep, not an extra)

Quick start

from pyramids.dataset import Dataset

# Open a raster file
src = Dataset.read_file("path/to/raster.tif")
print(src.epsg)        # coordinate reference system EPSG code
print(src.cell_size)   # pixel resolution
print(src.shape)       # (bands, rows, columns)

# Read the raster data as a NumPy array
arr = src.read_array()                  # all bands
band0 = src.read_array(band=0)          # one band

# Spatial ops route through the spatial engine; the facade stays short
reprojected = src.to_crs(to_epsg=3857)  # same as src.spatial.to_crs(...)
from pyramids.netcdf import NetCDF
from pyramids import Selectors, ColourOpts, FacetSpec   # grouped plot options

# Open a NetCDF file
nc = NetCDF.read_file("path/to/data.nc")
print(nc.variables)

# xarray-aligned plotting (needs the [viz] extra)
nc.plot("t2m", selectors=Selectors(time="2020-07-01", level=850),
        colour=ColourOpts(cmap="coolwarm", robust=True))
nc.plot("t2m", facet=FacetSpec(col="time", col_wrap=4))   # small multiples
nc.plot("t2m", animate="time", chunks={"time": 1})        # lazy per-frame animation
from pyramids.feature import FeatureCollection

# Open a vector file
vector = FeatureCollection.read_file("path/to/shapefile.shp")
print(vector.epsg)            # CRS EPSG code
print(vector.total_bounds)    # (minx, miny, maxx, maxy)
from pyramids.dataset import DatasetCollection

# Build a lazy stack of co-registered rasters (no pixels read yet)
cube = DatasetCollection.from_files(["a.tif", "b.tif", "c.tif"])
print(cube.time_length, cube.shape)

# Reductions over the time axis use dask under the hood
mean = cube.mean()                       # nan-aware by default

Testing

This project uses pixi as the environment and task manager.

# Install dependencies and create dev environment
pixi install -e dev

# Run all tests (excluding plot tests)
pixi run -e dev main

# Run plot tests only
pixi run -e dev plot

# Run a specific test file
pixi run -e dev pytest tests/netcdf/test_dimensions.py -v

# Run a single test by node id
pixi run -e dev pytest tests/netcdf/test_dimensions.py::TestStripBraces::test_with_braces -q

Docker

A Dockerfile is provided to run pyramids-gis in a controlled environment with the correct GDAL stack preinstalled via conda-forge. The image uses a multi-stage pixi build for a minimal production container.

Build the image:

docker build -t pyramids-gis:latest .

Run the container (mount your current folder as /workspace):

docker run --rm -it -v ${PWD}:/workspace pyramids-gis:latest bash

Inside the container you can verify the package is installed:

python -c "import pyramids; print('pyramids', pyramids.__version__)"

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyramids_gis-0.38.0.tar.gz (741.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyramids_gis-0.38.0-cp314-cp314-win_amd64.whl (37.5 MB view details)

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.38.0-cp314-cp314-manylinux_2_39_x86_64.whl (50.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

pyramids_gis-0.38.0-cp314-cp314-manylinux_2_39_aarch64.whl (50.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

pyramids_gis-0.38.0-cp314-cp314-macosx_11_0_x86_64.whl (47.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

pyramids_gis-0.38.0-cp314-cp314-macosx_11_0_arm64.whl (41.6 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyramids_gis-0.38.0-cp313-cp313-win_amd64.whl (36.5 MB view details)

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.38.0-cp313-cp313-manylinux_2_39_x86_64.whl (50.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

pyramids_gis-0.38.0-cp313-cp313-manylinux_2_39_aarch64.whl (50.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

pyramids_gis-0.38.0-cp313-cp313-macosx_11_0_x86_64.whl (47.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

pyramids_gis-0.38.0-cp313-cp313-macosx_11_0_arm64.whl (41.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyramids_gis-0.38.0-cp312-cp312-win_amd64.whl (36.5 MB view details)

Uploaded CPython 3.12Windows x86-64

pyramids_gis-0.38.0-cp312-cp312-manylinux_2_39_x86_64.whl (50.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

pyramids_gis-0.38.0-cp312-cp312-manylinux_2_39_aarch64.whl (50.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

pyramids_gis-0.38.0-cp312-cp312-macosx_11_0_x86_64.whl (47.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

pyramids_gis-0.38.0-cp312-cp312-macosx_11_0_arm64.whl (41.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyramids_gis-0.38.0-cp311-cp311-win_amd64.whl (36.5 MB view details)

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.38.0-cp311-cp311-manylinux_2_39_x86_64.whl (50.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

pyramids_gis-0.38.0-cp311-cp311-manylinux_2_39_aarch64.whl (50.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

pyramids_gis-0.38.0-cp311-cp311-macosx_11_0_x86_64.whl (47.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyramids_gis-0.38.0-cp311-cp311-macosx_11_0_arm64.whl (41.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file pyramids_gis-0.38.0.tar.gz.

File metadata

  • Download URL: pyramids_gis-0.38.0.tar.gz
  • Upload date:
  • Size: 741.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pyramids_gis-0.38.0.tar.gz
Algorithm Hash digest
SHA256 e9db0806132758123e465404e103d039516ff45bc0cfd23e4e8a19680660000e
MD5 3f35b52c97905faed34f7695015f012d
BLAKE2b-256 237c3dfc969f9c8cdbea8732a982d60c90f4f334e3145d972174157c1fdf01e8

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 58f293734f45b87fb90e55b8bd86c2f4c8eba6298bccc1eeb5df3af498df50e0
MD5 453f9ef25fac83559e441d7a37108be3
BLAKE2b-256 4306b1d1f17abe2c58c4d3bf70f051d90ee5c7620ebff529280134363801cd99

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 b6a6a6cc322c2686ce5667aae954c9338cc60249f600cdeebc34890d93e74d06
MD5 7b488f5e431e45e25588baf7e20abb9e
BLAKE2b-256 8ecff94abf5bd132c15f4ba638e19acf5c95e63df5781656e1eaeb2cdd3e29db

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp314-cp314-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 a2208c92597c4473736d719a4034dc4b8132c05c623a0c7587de8b77cc30dfcb
MD5 6389be7e2fe719c571a2ecbf9527dfdc
BLAKE2b-256 ec7883f5b995e56dc307a28db240b8fa75c6a85999df9805c6be939b47b5ca96

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp314-cp314-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 59a3b641b954fc8bd88397e6310a27fedc42038eae239c241c07312cda62c887
MD5 3c4dc087e3984c4a0b0b776967bb3959
BLAKE2b-256 c731fca4b7f3654015f4897c86270266a9ff1cdab471e316f17c42733fce47a6

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 906ffd4a2e7c9291db9661f06d9fbe8220a62d81b0f34335fe52986ab93e76bf
MD5 04728b49ae60c4d591cdcb6b91a1392d
BLAKE2b-256 c862111283a88d1006f4bd6cae2faf4df65b391d35e30762ed65e7df821ee528

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 26f4c683ea4f200df0006af32d938d12706a8c7f923c1970ab29629984335f00
MD5 9bd8d74902b3b92a2aeadcb70ec6a0d4
BLAKE2b-256 44b9e619a623a7bfce995df2335e27a5468bdbc6f7d55d325502a0ea8b1ba87d

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 2e1a8db78d622eb0dc8a5685a4851438f6f525fbd44a1033c70c89d2ceaef52f
MD5 c7800e43da27adfc13d87c431f9b8852
BLAKE2b-256 f5cfdd6ac9c65d9b8f7ca44398c3d2b572ffc82d9e4597e9c87375b94206248d

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp313-cp313-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 3d0057e2cf26cb9603dde6b28cd5dc27e270eeccce2ab51fad597a376b802f6a
MD5 d5fcf78c7cbeb78987e49e622d4212c7
BLAKE2b-256 2dae3e763ad282f2e9a461a32078db068660d8c0c5e9197f0aad6719e198820d

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp313-cp313-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0b30b125fcf5bc9fed9af75562f5f40785838bb5188bbec1ab02387bacd480f3
MD5 6f7fda0d609618214acb457d1d56d676
BLAKE2b-256 38e05652f875cea0a18103bfe5e1bc233a9190a7bd5ef5b56f785dc33579bb52

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9af094be6d882dc3a7afc457539d6c483931d5818034cb5e8299ed98ba69c81a
MD5 a2f4b913e39061682565141e097a5def
BLAKE2b-256 eac34e7c25f5c063564be027cadbdbdf0a960ee8f7dc49ac3a4fe017cd297ffd

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 84a849fbaa43200b6527107d3e5dd5a69bca84b411f731f80ea2d8380abb7f8e
MD5 8794debbd32cb044b22d6f8a57701fce
BLAKE2b-256 9e97b49385465dda7e823ffc011ed8dcf66269bb057fea09c493c3e5d02265bd

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 fc2bafa3e774d989b117fc07eff41258d6db08684fb726eb5dfa4ee34ef5c187
MD5 dcf134d78a3322a9faa6dc5c488b47e0
BLAKE2b-256 ce16e29915c00e75c19178c45caac1090b47e0527b6de67dfdc3c5ebf5736751

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp312-cp312-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 eb3e9c409c23024c02335f974d426583b8c141a1acd900426bcce7dc8adc4a7c
MD5 e026df14d5b8b4a4504897619d2f02f7
BLAKE2b-256 62275f86e5650fd58aacf2128c7d55aa375bea6df27abf1dcb77090255296331

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7daa86e19d4e768ae6bf657a9cd86b6aad8ef45acb916ff2c64525387f3a958d
MD5 bc2a923a72df223d75fcf19b8b193c44
BLAKE2b-256 73617ceb9d5d2410fdfc536feca6acb49af2b609a0085c8aa5ddc2fea79fc36c

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7139dc8e9780a8e1b16378831425068c56d204f66f6c1b236014edaea45d3ac6
MD5 28493b6a34b2ca0272b93abd8be62065
BLAKE2b-256 eb9e697f60b61b00a9e1834e44f3a9442baf91a2564e7a8113f1862dd564855d

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fe345fec820b2954dfbf99be5b9b2037ae2c101cec2fd93b93e43d638e829a60
MD5 9a0cf9d08acc58e6c619f3f3f9a26f12
BLAKE2b-256 0ea276346091bfd9eae9358a58564e4e591b5d796c2eb7f4e1c353d244ef73f0

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 0647ece5d9ad274a2d02c0f3faa75c1bcc992f39d4ac2a83568f7e80bd9bdd54
MD5 9531556c4831a3b33461453324b8bf6a
BLAKE2b-256 bbb4fd921fe235cda72b9c6f6eee202dd11d791e28519a5405db101be7128f8c

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp311-cp311-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 214442746d14428d6e74eb6a85c2d2156f9ef4600430d015dee202098d7b984e
MD5 4ce11bd3b868d4ca20c6600789a908b7
BLAKE2b-256 0ca498b9cf7dea1fc5118c2e32d6bd7f25af1a9a201620f4799f9847a1589121

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 4967e58a1ebf4ad370cb554fb826579ce6d21ab6f66e40090520df3a70295540
MD5 cd4cc235489eac520a237fd9ba5dbef6
BLAKE2b-256 ac20af0260487eb06c233af74de4536f549c0c4abacb3e327757d8708762be1b

See more details on using hashes here.

File details

Details for the file pyramids_gis-0.38.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyramids_gis-0.38.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 364e25e160f28232645477c31557c6ca28cd2f12bcb222f6162585c5c1b3ef4c
MD5 8a0f3500af4403dab9c787e2f6cf147e
BLAKE2b-256 136274218a7e4835b6c53387660899d969e54e177bc24f6c75096ff601cf4f73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page