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

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.25.0-cp314-cp314-manylinux_2_39_x86_64.whl (64.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.14macOS 11.0+ x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.25.0-cp313-cp313-manylinux_2_39_x86_64.whl (64.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

pyramids_gis-0.25.0-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.25.0-cp312-cp312-manylinux_2_39_aarch64.whl (62.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.25.0-cp311-cp311-manylinux_2_39_x86_64.whl (65.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

pyramids_gis-0.25.0-cp311-cp311-macosx_11_0_x86_64.whl (56.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyramids_gis-0.25.0-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.25.0.tar.gz.

File metadata

  • Download URL: pyramids_gis-0.25.0.tar.gz
  • Upload date:
  • Size: 529.3 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.25.0.tar.gz
Algorithm Hash digest
SHA256 14842e13a7f1b5a5d9d07c38f883cd3982a1ea0efb355ab6e56c24eec47db857
MD5 fc83a5670df7f0967f505bd0159cabdc
BLAKE2b-256 47af52e5de509712e2097193171cf05d46fe65845952b431cb9734906aa71837

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 41b3aa05678ea5069e1cff055af9ce66b093c37f1e6b89b0d2828b99cc2c66aa
MD5 51a1072ad8d59d66e02efb962861731d
BLAKE2b-256 c0daefa96d9bd76ab935481a2e9f796934e938a3a4058bb30b531301e720619c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ce9add1642b5945f2c9eefe40577324e4b9850eb2ee900258015d0512d4b7b8b
MD5 269650989d121eadd33cf16ae04252e2
BLAKE2b-256 ecbd227fd09d3c484aa815a59a21bb763c399fae4d0d9119f19577f6f362083f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 0577943b572a6aeaac6bd50e3962e66c80a172c01451e0d2d39c86e6930f16a3
MD5 b111e927d573aa719008603891cfbc00
BLAKE2b-256 a8a4019c3461e54108188ab51bec83a438e0f8875f951624da484d0df6083929

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e38a7c058ea2b9d24c0b02289d92b33ea74770edf7b316029e607b098eaff943
MD5 d079a42df2c7f24e87cac22a0ed3bfae
BLAKE2b-256 5941ef529023ead9060c63fe6e631bad9e587afbffa22c3ddfb0e6dcbcf5a463

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7aaffd95c9dd7ffc28a9121aa94d07035b333d2d069bd6c80b21f27f2695216
MD5 86ebeb4446c0588f8b30da74045e9d09
BLAKE2b-256 8d40ad558bf67fb59fb08ba7d786b44961cb86ec6f9797b728590e66fe68b8d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 33ebdbc5682fdfb1c5170a2745a46fe86f824a3637f5b7d43696a287527f255b
MD5 fa3c415505c0b91ea3146d0157b93f99
BLAKE2b-256 3fed3926f238e02ad1e2a3b307fa7453a6cbebc52c9789f3811c329701797ea2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 73645dae37ea019da3561be172e60aa03eb6ad2cd7eba5b20d44e87c8b53a0ad
MD5 341361a1dc3b9b5d0aba28ea650c653a
BLAKE2b-256 e9ccfaee671c3d5a6b92b11d2311ebe2b9bf8cf8d9b9c7424f45b8a556ce5ea4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 a542c6fe0377fe6c480d9e6e0dfaf7414794ab4f0fef0cac315fff73600e38ec
MD5 9497538410b55262567b80c3b0ae1bcd
BLAKE2b-256 7967ac2666f909844351d5ee29195c452a4717480e062b62e45ce15808002068

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9fb264ef9ed75c218a7ff1213aa7d7bdc7bae49f52360fbf5062fbc0177eb7ee
MD5 78b56f528cd9d741db38be902bfdfa01
BLAKE2b-256 a2840bec468d34003bed65409ce4c7170614585acbabc59fefe6b9070d02517b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04c561ae50d8b8eb10db86dc00c2e17386878fa4730a4b1a187c831ab405b2b0
MD5 ef4110bffcfcdc7f0cc92a6ba9217dd5
BLAKE2b-256 8cc9d6923d7883fcd265540bbda4f699d01beb7144bbcea7a0e8423b958912f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 81baca89b4dbfc84b361b0da2ecfa975eaa93e1a64b5aeea2bc32c4d5328f8c6
MD5 9200759edc8650a7b6863d619b1501c8
BLAKE2b-256 c1dcfdeca705e1a6c7e1164f86fa0a4e4666a45182fff1166c243a3ba02dd196

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 cba879c8b149744b35fa04ffc14097f1d8ce8eee6eeb6f1e98990de3898ad2d3
MD5 d0868d640903531083351573b7069298
BLAKE2b-256 edb048464ec307fdd7ec271a5047eb7112f40384ad04a279511a4bde2e633a8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 a227bb20ae5c65f1d5d24acbd02db37b03c5bc53a6ff0660f66dc9fc870b11a3
MD5 7483c7ccba202a17d83acecfa5f3f661
BLAKE2b-256 cecfa6c32bcec424ac5705ad3753f952410a5713293d96f0f3c6aebdf9a93588

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0540d3626bd62b3008b7ccae86bf8db10607b5fbd1a1b1ab0cf67a30d4e2f9e1
MD5 6d4c2bb52d67837aabf2cdd6b23a0629
BLAKE2b-256 253d49b95571a933727822323b56f64f17c0cd5dba33f24312e4b397189e936c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ab87acf29fb98a661ea799bfd2508f6de26994cfc40704aa70a84bd117c8bdfb
MD5 f68105b2a6c80150b20be481cea44c4b
BLAKE2b-256 b9d632f1b801054368ffd7506bde61641bbe1bdd61d07a1b16f6a75f107797ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4b4ff519bdebf4a6da9f229c43c90f5f32b2bc60c513ec83fe03d6d9ed4ab046
MD5 a3bd2658ced95e10aa45016f2e984ac8
BLAKE2b-256 788266461e44ec51a4319adafe16dca98153a9a05308c1e4a729f23ea03989be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a4bed25ba49770b5a9d79a978ec5f00184513383b70c4ab33b139dc8a276d36a
MD5 2135508747be1eda24b7137e40220cbe
BLAKE2b-256 600fd9f1e24e803e76051e4501af49bd50b8412725d4d5ce79c0b19706316a44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 29a9d6ac6af879348b12c92f99367a8dcb3917f70a8d8d22a00e185500375490
MD5 4bf103802a1944b8a8343131bbb17511
BLAKE2b-256 c62bf55d006b84d01f63009cc93143ba000ed2b85242bb8b566988f93098e468

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 35706e011ddc638feb0732c9d2a2b48afcb41662bbb85d50729375cce01c5af0
MD5 c39c81648a61bca1ea285185b6f183e3
BLAKE2b-256 069f0b44c0c795d1f31637ba99df11aa891b5c115573ce273a516316ec572d73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.25.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53555dc5d030d7964589d6b91ca1b889997b530a57decc6ef9f44a7094fd383a
MD5 506b1c96d3f94ab9bf76c474bd7953b8
BLAKE2b-256 87b7666fbd6ce0bdcc9670ac4e13bd73e7dee2bf60101d71b29c38121a425ae8

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