Skip to main content

GIS utility package

Project description

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-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 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 pyramids-gis[xarray]   # xarray/NetCDF4 interoperability

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


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.24.1.tar.gz (517.9 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.24.1-cp314-cp314-win_amd64.whl (37.2 MB view details)

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.24.1-cp314-cp314-manylinux_2_39_x86_64.whl (64.6 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

pyramids_gis-0.24.1-cp314-cp314-manylinux_2_39_aarch64.whl (62.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

pyramids_gis-0.24.1-cp314-cp314-macosx_11_0_x86_64.whl (56.5 MB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

pyramids_gis-0.24.1-cp314-cp314-macosx_11_0_arm64.whl (51.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyramids_gis-0.24.1-cp313-cp313-win_amd64.whl (36.2 MB view details)

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.24.1-cp313-cp313-manylinux_2_39_x86_64.whl (64.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

pyramids_gis-0.24.1-cp313-cp313-manylinux_2_39_aarch64.whl (62.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

pyramids_gis-0.24.1-cp313-cp313-macosx_11_0_x86_64.whl (56.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

pyramids_gis-0.24.1-cp313-cp313-macosx_11_0_arm64.whl (51.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyramids_gis-0.24.1-cp312-cp312-win_amd64.whl (36.2 MB view details)

Uploaded CPython 3.12Windows x86-64

pyramids_gis-0.24.1-cp312-cp312-manylinux_2_39_x86_64.whl (64.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

pyramids_gis-0.24.1-cp312-cp312-manylinux_2_39_aarch64.whl (62.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

pyramids_gis-0.24.1-cp312-cp312-macosx_11_0_x86_64.whl (56.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

pyramids_gis-0.24.1-cp312-cp312-macosx_11_0_arm64.whl (51.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyramids_gis-0.24.1-cp311-cp311-win_amd64.whl (36.2 MB view details)

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.24.1-cp311-cp311-manylinux_2_39_x86_64.whl (64.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

pyramids_gis-0.24.1-cp311-cp311-manylinux_2_39_aarch64.whl (62.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

pyramids_gis-0.24.1-cp311-cp311-macosx_11_0_x86_64.whl (56.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyramids_gis-0.24.1-cp311-cp311-macosx_11_0_arm64.whl (51.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for pyramids_gis-0.24.1.tar.gz
Algorithm Hash digest
SHA256 90bdccc789eebaefd468fd0c0e3687191daa8281028c632de2e28673b182c174
MD5 2560fd4d560c4c4f6c6406fb451ece5b
BLAKE2b-256 33b1e9d3b79e6f2077407fc2beff35d607a31ff7a0116d96139d143feb5f2b9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 9e01cb47605e8b7ac80a37bea7587862b500b1c0154aebc01b9bb4864c1af204
MD5 da1dedb0ab872487a1b4d63ca7acbdc0
BLAKE2b-256 4b570537652051c522e414c1b791446dbc4d1468fccdf6d06260e25e7c738944

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 4450ec650bcfbac1eb45fda70fb3b1ac359317225587eca1ad5871408416b579
MD5 c96ba88c40d10d4276c827ef5a108a4a
BLAKE2b-256 1bf3beda8764d7ac546f2629efab3a4c48a937225d31111be6ab1410033cf798

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 aa6dc48635ded836926204114cacba6deea0540e6d19fdc05717acf077b4c61e
MD5 c9bd1f7177586924057f14d5f8d8c34b
BLAKE2b-256 316c008c64d99be3109a35834176d830943d8e7a8d0f807554b4678d76bdbe3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 4b406c36ef75c95e254c779fa3314ac36bc2587137587f137b0d5e64cd587687
MD5 4e2aa8261a28341800579dead65e29c8
BLAKE2b-256 d8e6d3abeba5e50c87d929e1e25feaabc06360d91d279a50e0936037c0d5c10e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb3e4d0df8f4e200f99923c89ba32e1dd3d5da5c20bb8c23602e230b8d6dabb9
MD5 96aa427d7d86d26c6f64ae22178616b2
BLAKE2b-256 9fca1dc1bf28f5db1050ab35b5d55394054b9f7a310eb8c39e6e702077aaaaab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7827ff40cb0109b7fe549ba6e63c7ab34acc1eed172b26940c20178755c7dfa1
MD5 2fb6e89e531263d54218d1de448ae32b
BLAKE2b-256 b259d123f3bb1cc0a1c1a675e77933a83e05c09832a4f9ec09a63224c6c292cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 8bddb3bdae45eba37db2b5e1c6521f2cfac9a08a4f5d504f307d27007f389f0a
MD5 ecb897e1594e648d1d5d37005b1841d3
BLAKE2b-256 c38c0177e4206cf73a7db031f1739064107133faabd8f07ecd892cc2cb2868ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 f01059b13c3aa50c971fbd59e345e5e895840acb18cffa662e53b2c6cf6edb13
MD5 f46b26c4e36888e9897ca4c00116873f
BLAKE2b-256 906441160d0b5adfcc1dfe7dd5f94dfe07f5f4afcc7c6141af38bc3c8fe2265d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 08096d34135ffd221574914e1049e8621e60e73e6add2b1962ae77826bbae849
MD5 9bbee8843d2b0e9a2d52d499828a44ba
BLAKE2b-256 af5b20f60ea4bea1bb31770ff8f3752b0a7f579eb4f40a39d27819dbec750e36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e02af3f9dfac2e04957dccfe8fd2510f06aed13d8075a12a42235746ebe13db
MD5 e283a69aa31fdd030269009849dd26c0
BLAKE2b-256 ada4567b4a7637226f1acfb6b7bfd372dc35f794b59f6279a52968bcbb2e81cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 23288b0a42bd65963d4edf29f908d2d0f8f6f793cde666140f4eef216c370c95
MD5 542dc0153190dcd3357d013c97e73d13
BLAKE2b-256 448b7d3d032a3d7ee77a7cbdcb0b6da08d13a6af3d209804bb8845772ec95659

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 26fc8b6d32d720fbd107a60d7e1aef20ced5c5d72155381be47aa3c05baff24b
MD5 3523044f59894cbd6e5ef02c2a846d4f
BLAKE2b-256 843a625fed264cf91163533d11157107ca69e3b5a86ed30d47d655fe0aef705c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 52b0999a4fc99261b277bb15aac82bab4daef08f8e7631ff6658e0e323161892
MD5 34b4784b1762fe7f1afbb6535511ad31
BLAKE2b-256 33ba69b266c349fad11783090a9e39c6c6f2bbab1dacf612985a57c500961c38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e28d6f7cf61a1085fc00d93cd3c7d41a70fb301aedd2274bbe46ed790fc50f45
MD5 534bc7e6a0795ffe38fc5c0b02b645e3
BLAKE2b-256 17ececb5112f6ea1ff5886f1da4ec56eb6ed6e98aa6520b7190c2bc2b90895c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9bd8da37b9d3ccd0514e5531fa89a31b87bf34be9752598c4092967eb80229cb
MD5 264049d7869e01ea6b696ac3156070c7
BLAKE2b-256 eafa75dd498ba12263b5c52eed427a8f59699a031105c7b4127926bbbac675cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a37e1881cd8186ba23317d28944bb62ae1d6965d19ac3005c8dcc3b0b023a786
MD5 790e87221642cb8ffc7c263fbec56683
BLAKE2b-256 72760730c25892eb506c4f55b000bb226342bda2976ab74c4734ad934b3a853e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c7651583fcb18fd5297a2442e695238bdb4fa5bb0513a30d1fe27f271642d824
MD5 fead95080e03261a78feeb2fa40c9220
BLAKE2b-256 82789732b17f31975e0e82cf25d532a90f1f53e0e27961475830ee0436a59d50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 b9183d0af59a5fb6bfd217d30b1a65e9520dc410f9001615024d9455162e30e6
MD5 f0da5b43b799001deb9bd29c47e0d49a
BLAKE2b-256 6c8274b40b504f62a8e3d46f8865ae8645dbe96d85d590bf4627c998e532a533

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 79d85cbce84cea220981c109b50d87073ad4871a2e4946faf637bfbf70b9de29
MD5 14f61d9e2efdbd4752061f462f10e488
BLAKE2b-256 6a5abb567209ab75381c349cbd41ff2fa62b6535906a5a32ff06f37e06934ac5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.24.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e388987662ac8924dd5d941e04214bbc6d2bbf104de822027738f395c182097
MD5 558452820dd516402f0f7cc7cc91c959
BLAKE2b-256 60fcb15e4bd4c3e9ae6633843364d29105bce3476ec4328a1a8a00d92aab9a97

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