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.34.0.tar.gz (637.1 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.34.0-cp314-cp314-win_amd64.whl (36.4 MB view details)

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.34.0-cp314-cp314-manylinux_2_39_x86_64.whl (48.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

pyramids_gis-0.34.0-cp314-cp314-manylinux_2_39_aarch64.whl (48.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

pyramids_gis-0.34.0-cp314-cp314-macosx_11_0_x86_64.whl (45.7 MB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

pyramids_gis-0.34.0-cp313-cp313-win_amd64.whl (35.4 MB view details)

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.34.0-cp313-cp313-manylinux_2_39_x86_64.whl (48.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

pyramids_gis-0.34.0-cp313-cp313-manylinux_2_39_aarch64.whl (48.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

pyramids_gis-0.34.0-cp313-cp313-macosx_11_0_x86_64.whl (45.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

pyramids_gis-0.34.0-cp312-cp312-win_amd64.whl (35.4 MB view details)

Uploaded CPython 3.12Windows x86-64

pyramids_gis-0.34.0-cp312-cp312-manylinux_2_39_x86_64.whl (48.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

pyramids_gis-0.34.0-cp312-cp312-manylinux_2_39_aarch64.whl (48.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

pyramids_gis-0.34.0-cp312-cp312-macosx_11_0_x86_64.whl (45.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

pyramids_gis-0.34.0-cp311-cp311-win_amd64.whl (35.4 MB view details)

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.34.0-cp311-cp311-manylinux_2_39_x86_64.whl (48.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

pyramids_gis-0.34.0-cp311-cp311-manylinux_2_39_aarch64.whl (48.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

pyramids_gis-0.34.0-cp311-cp311-macosx_11_0_x86_64.whl (45.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyramids_gis-0.34.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.34.0.tar.gz.

File metadata

  • Download URL: pyramids_gis-0.34.0.tar.gz
  • Upload date:
  • Size: 637.1 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.34.0.tar.gz
Algorithm Hash digest
SHA256 0a1c03019fffa45b7df83c2b65dbaf8c3f48b5ffb4d1873271449f4b60ad3169
MD5 5d10bcb9261e6b4cb7c1c0dcbe989afe
BLAKE2b-256 5ae56f452561a296246f0f32ff0ffb72e5b61c321d135b641295478c8c61c3fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0f5f86558c2196a7a6f612cad3f87fe7f2100b956038d82b3cc3f08df3b98a70
MD5 06e277fc98c18373e02cc9ca2597deb3
BLAKE2b-256 c2a64f929e6b83bed02d324c3bbc63c98383f9e7789ec1f4bf2e8355e2f6b58f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a5417a6d88cf8e920b6f449b2635f890822d446a258b7b3c2bcf56830f3fc018
MD5 06bea06b8aaae17e783be0ccf098e4de
BLAKE2b-256 394d507b7c0b57802001680e5eecb9b2f26a20ac74a692c223c80a8721c0fcf3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 48d7099be3fc87a33414bc81e5ac7572eac815fe8d471736a4a32b3ff1606daa
MD5 7df12587d538efdd0acbad0369469fd3
BLAKE2b-256 fd0b36bc4e3210d38028ce4fabe98fa63a69cea31eda1c52eb300948569408f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e519fc3ef94849f6e7ef6492697275f81c45c5ed9323012a1e07c0418c34ed9d
MD5 c8d3639544a54b8280429439b4f49e23
BLAKE2b-256 7877df5ac60ed715fff78437f73559cf826f8739839b93b6a002f955079b78ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77c950b17dff86e5f78ff89533a6d4d56cc9f65c68e5ad725ad81cb182e784dd
MD5 ffafd0e4f0ab877f6a701ad3a4932719
BLAKE2b-256 ffb4062fd0b87c6e7a336bfbdc30deac1ed6edee5ed4129a224f233b359e592f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 17634634f8793dd4d5196b97124cb571f5fdf837370f6da2588d6c2dea3ef876
MD5 5214be4e3481200d7ee1fd1b491e7bc3
BLAKE2b-256 1c464fdf3222320258cb92e8b2dbfa4ddda38491483a71d094038f21088b976d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 011e70dfb74c2e0cb0a559389b8f2233cbc3c4bf36fa87aa116cdc98f15f0b88
MD5 ae6ffe3dabd6d552777a98d62ef02f7b
BLAKE2b-256 df505a8844308d02383d64dedd3b4a00082a8a4a2f734c3f73f7d4a55d7f1b30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 263091fc90857c23e4171fca6e2c4aa5f9c34459376145ea53d6f9c023748000
MD5 d1940f18d6da38cc5bb6f2fb4b67759e
BLAKE2b-256 01553203f6e79e65fe76b1a172f8837bb8c2d108bbb1073b3b448c78238e8b98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 1c6b275307e4480a972754fc30fc0f207f72be5ce71c8529b117d3f01ddbddad
MD5 11398322b64683c554a18158213c3cd5
BLAKE2b-256 fc20ac5ceaa837764624d5bd02d4f6ac1e6e114fba182ce9d9219dd16bda887d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b089453021a14d2d4b7a13bb0f2c4b2ea90d4714df2072988a52bcbc7954156
MD5 c2b57fbdb52627d0abfdbe3d8d51c043
BLAKE2b-256 b2d9faab4408e92282cb1c1c96dae2ffffb24fe67335ee61b557e5529a82d79c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 94f6eefba54ef7cd9c147e02b2ee1c805e421729610b1787d91437463efa7b0f
MD5 4347a27a3e9ee3185c01b3dc2239ec3b
BLAKE2b-256 ad6e2fcbb7a0099c6b2d2dfc2dabfc19638b827a0dd82d6c620adc3cbb31bb0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 9f0daea9029cfcbfd7b764d7534df7ca3f15db82c8808cb89e0f39e82bfdc00b
MD5 008ea69547bd71fc788a2b1996735262
BLAKE2b-256 e54e8279d0d5f4bafec03fe76147f2d6d066faa6bbfa62a6d68bef2dd11cb9ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 87ba00444d3b61a3d80cd12470178ccc19ba17906737f94e7559d9e676402045
MD5 c6979bb73b6ce8fff1a2e47673540220
BLAKE2b-256 65de83820536c1279b76781052e591bb25770f7ec3386e51cb3816c3e3e2ec6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 395c5c2c3983a94f9438b99946aed40801d8beed2e219cdbddfbb4600a09568f
MD5 b7b5de1582b4e2e78ca0788b334a8cad
BLAKE2b-256 b70644368d23ffa925a9bfd57a5d287911a1396812451f6c00fa10b9e72b2cff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 51709ff4328f77c39d841e9fa0c1cc9f7c14e3e698f421ba1f724e1e55d52ccf
MD5 00ba205673bc6840f5ee9384609fe36a
BLAKE2b-256 e5212b3cc1e8423988b97ad15594155b5a12f30fa6655b2be223bd2e6c81b85a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0600bba956d6b76c408fee034b27efd0d17685ec79c35b40afce999da4e14175
MD5 58475682c62f23ca4f78dbd2de2fa76b
BLAKE2b-256 ae8916e5ceda55d4a59728abbd4cc63759fc4256c28562d8c7035b547edc27da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 4326332ee007db36fdc2fe3330901c1f517d7c536bf6a6b1603f5d230a589bb8
MD5 7df52ee6e6d6aebc066bc6f82c58ca6a
BLAKE2b-256 b528823297f2c658da0153e9ff4cc985d65d86e3fda7671af3614f288c8341a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 0cac28bf586f8b25fa63e7fc34b6505f4cadeeaaa9c2b520d6ae1b0d75a3022d
MD5 efaa530cba09a8e44f9b0dcd9c845cce
BLAKE2b-256 da1896df9068eeac3cd9674599415757eae81da71aea7eb2065a1efcc8da720b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e70998a477d0d7f0c3ac58d046fe3ed1064a718261efd606faf190cbe392781b
MD5 12fbdb756afff4a34a8e8301f3d71fc4
BLAKE2b-256 b3df23d6616347a56b28bc288d9cc9087bef78846316ea1a18c474a0ddfc0111

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.34.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2d7fbc7de0bc6fec4e4b97004bf36967ea470698d9180c2fd419603a7594a8a
MD5 807201286fb14b8ed1e88874df68b3b8
BLAKE2b-256 42888fa262e3d44de5976d77c762891851f4ce8489cef9a264319783e60e5436

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