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.37.0.tar.gz (720.5 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.37.0-cp314-cp314-win_amd64.whl (37.5 MB view details)

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.37.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.37.0-cp314-cp314-manylinux_2_39_aarch64.whl (49.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

pyramids_gis-0.37.0-cp314-cp314-macosx_11_0_x86_64.whl (45.6 MB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

pyramids_gis-0.37.0-cp314-cp314-macosx_11_0_arm64.whl (42.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.37.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.37.0-cp313-cp313-manylinux_2_39_aarch64.whl (49.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

pyramids_gis-0.37.0-cp313-cp313-macosx_11_0_x86_64.whl (45.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

pyramids_gis-0.37.0-cp313-cp313-macosx_11_0_arm64.whl (42.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

pyramids_gis-0.37.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.37.0-cp312-cp312-manylinux_2_39_aarch64.whl (49.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

pyramids_gis-0.37.0-cp312-cp312-macosx_11_0_x86_64.whl (45.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

pyramids_gis-0.37.0-cp312-cp312-macosx_11_0_arm64.whl (42.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.37.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.37.0-cp311-cp311-manylinux_2_39_aarch64.whl (49.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

pyramids_gis-0.37.0-cp311-cp311-macosx_11_0_x86_64.whl (45.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyramids_gis-0.37.0-cp311-cp311-macosx_11_0_arm64.whl (42.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pyramids_gis-0.37.0.tar.gz
  • Upload date:
  • Size: 720.5 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.37.0.tar.gz
Algorithm Hash digest
SHA256 98f368ae67605b22b858064521ead11d8eab9a7de3d6729e706ea895c56b47dc
MD5 6df9e55a7ee8f71e4455f58ef499a32c
BLAKE2b-256 bad24afa99a305d1403485f64dd41577f15f8b0bcff49669afa7859ff4a625c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 339df572992140e03719b5b60c0b3dbb94018fea57bb5604354745c2369b2ec1
MD5 9e2c8eeeea5bcc4470ff0c0fd1118930
BLAKE2b-256 2af5ecb66364ec1b4266baf409970d4b8ff1fb578655e8165a6678d212f308b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 076dc7afda82024fcf0de7ecc6ab9f39618da961c3de8dae5057b06f8e89ae84
MD5 72a355f8860d91730c20456632dc0c46
BLAKE2b-256 d40c25e98bc238b87a07fec575c444b0e8a6988c70bbecbc7883fd8a4bc0e597

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 60063909510e3557e447ba66c76bb583f46870df27bc990cc620d62f13cc5d6f
MD5 1cab0d03870bbcd115bb72ecfabec7af
BLAKE2b-256 cef5cc9060616fe9d7a571131bb0726543877b15a41e276d839634ae8928a830

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 cf0134fdc0c522ac2eba9cd58f8736724ee3776eaa8fb7960820321fd4378d88
MD5 6a33f507477152b5be175329c4fb3f86
BLAKE2b-256 7bbd381e6a309ae7a0f6a9b2fe9aa6be6f4f50bed9f765dfea02d5c798356a72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 49e811c02f04b1186a79b55c58c79dc65b438ff6fd3e02c28d436e3c16a42f76
MD5 ba1884f9ebd77324b85550d23eb17170
BLAKE2b-256 f070501e8cfa996b88153a6dbcc779cc7b5f9e9a63e8e5e3af6dba089300ba0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5864ec9de390fd44f6dafa31ce6b1dd96cf09ca3a111130068bdb503cc680421
MD5 1c56bca0af75b36eebb9ee46e0a291fb
BLAKE2b-256 614cfab84f2523fda36c7d17d97588e92ec4bb48483cdd23fc8cd958ad77dc18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d7d719c3e036127adfa895db6ca3556a012253a5d51e10e60d9a484e8d172ecd
MD5 cc516b4932dba0372e628ff4af225469
BLAKE2b-256 2b95f9c86ccdc02d920b02fb2af36fd42c69d7256f837c6e402220dc99bed01b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 d29c601ab0523f3d2782748f6ea7e462d2de78ce5c2d242be83e6468150de401
MD5 db4e16c2eda3cecf45c79a9e21c359f0
BLAKE2b-256 dc567e23edcfe04b6bcbe13c727298192723d362cff1309004ce355977fca86e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 1065b79ce6a703cd2a12f4593186d41cd858a2ddf10e44e5cbed2241f26e50ed
MD5 6f141e0423350f1a72321c52429bae82
BLAKE2b-256 5ccb29d2cb1c5f98981138bfb86680a3e1851bb605f8489c72dfb253ac9cc018

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a1a7e35ad6437b00d41ccb79e49ffe9eabf451eed83b536791916c4d3419a6f
MD5 1b4ae3779323fe4ddf492a9cf98d8cdc
BLAKE2b-256 d00d51df76aeff18254f28680911e089dd9655906f16e3b2845eac6a0fa1293f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 92bf8f7c0892dd0e773a3caf6b516e70a99efc5a8a66eeb208e57b59405d1500
MD5 8b63d60aa4b726e89744ad137b2c685f
BLAKE2b-256 845137e870a170ffdbe9bcc19e36669d245e0609d651af25f52bd5e18d89fa43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 68eed44682c7f76ec6ccf22ceecf315272ec58d1e7fd4760be38d3512a77165d
MD5 28b47f984770647134109ed6208db585
BLAKE2b-256 1cb30ec71290c92e609a4ab4ea29048e85fe2f3c4722bcaf5d4d79a9a64d7e47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 7bf00bf31022a5908905a30e4124c59fe153256c6c8bb337e30a8980933ec0f2
MD5 7c81f80b7a4c48002ec7ac04af51478a
BLAKE2b-256 ff1400650179eeeb4e044412b4074b431ea1574b9914bfcaa7836292324827ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 52c88ac0d45dfe16d900f52153f182ea238e92969c651432dff09280e5ab15fd
MD5 697ad8cca90ca4b66e7c1fa59597b8b0
BLAKE2b-256 348109f1049c0a6ea7e2a1b877ca63496702257989c7b99e84dd65a5bcbc3b74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6eed317e9557f2432e103ba9363de4c98e425e05dc4cf0fb2af2f6b8dc63484
MD5 bdb6be77cb0eda97d1a90929a84dda44
BLAKE2b-256 413a74ea2589a542ba1410a1a45f9ab6fcca3c60d11b604ff0b1eb92296d5d21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0ea6b8ae5d5d4b8f95bdac5878c802e31b7770ed03e6e583c12c48b0598d2d87
MD5 14cec7ee3f8cc7f309441105ed9772a1
BLAKE2b-256 3e80c281668e343a7c7a95435ccc4bdc0812ef804d49075b5e27d3eb216fe4e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d7a0b4fa094476746dbdf09d48f5ca91433420208478acacf172694a5b16aad2
MD5 4635fe9b992ed851578d641f0d74d135
BLAKE2b-256 c16c384eb68105c902936fc483d95e326f45d515680e2a67aacf430f8ab12993

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 6c7fd285f123d166d87de878de9a2e6b4c017abec3658b30c8eb5700db3a59c7
MD5 c35073e61fae054e2952f72f5839736f
BLAKE2b-256 de75b0796006083fe732f6e9f06982dfc1854f8ff6ffdbe62af04b9d181dd86c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a78e7c75495cb7501493e37d457ada90e976209a2068e68fcf832aea7672f308
MD5 482d98be26e6c655c099f7432c6a627e
BLAKE2b-256 fab3ad3f064dbbf8761020d79d117887706ede76c8fa361110d1be3b4b0fb5f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.37.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75b071a42155e45bd11e99a9473327400b675ae5b332b016c746d3d7f88a8ab3
MD5 47e1eb569d6657ee166ce48c8e33a737
BLAKE2b-256 69821c39edf9c74c899c21f447df7ba3983312a280e748ae3fb130563a88b2fe

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