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.20.0.tar.gz (422.7 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.20.0-cp314-cp314-win_amd64.whl (36.7 MB view details)

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.20.0-cp314-cp314-manylinux_2_39_x86_64.whl (64.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

pyramids_gis-0.20.0-cp314-cp314-manylinux_2_39_aarch64.whl (61.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

pyramids_gis-0.20.0-cp314-cp314-macosx_11_0_x86_64.whl (56.4 MB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

pyramids_gis-0.20.0-cp314-cp314-macosx_11_0_arm64.whl (50.7 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyramids_gis-0.20.0-cp313-cp313-win_amd64.whl (35.7 MB view details)

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.20.0-cp313-cp313-manylinux_2_39_x86_64.whl (64.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

pyramids_gis-0.20.0-cp313-cp313-manylinux_2_39_aarch64.whl (61.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

pyramids_gis-0.20.0-cp313-cp313-macosx_11_0_x86_64.whl (56.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

pyramids_gis-0.20.0-cp313-cp313-macosx_11_0_arm64.whl (50.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyramids_gis-0.20.0-cp312-cp312-win_amd64.whl (35.7 MB view details)

Uploaded CPython 3.12Windows x86-64

pyramids_gis-0.20.0-cp312-cp312-manylinux_2_39_x86_64.whl (64.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

pyramids_gis-0.20.0-cp312-cp312-manylinux_2_39_aarch64.whl (61.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

pyramids_gis-0.20.0-cp312-cp312-macosx_11_0_x86_64.whl (56.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

pyramids_gis-0.20.0-cp312-cp312-macosx_11_0_arm64.whl (50.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyramids_gis-0.20.0-cp311-cp311-win_amd64.whl (35.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.20.0-cp311-cp311-manylinux_2_39_x86_64.whl (64.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

pyramids_gis-0.20.0-cp311-cp311-manylinux_2_39_aarch64.whl (62.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

pyramids_gis-0.20.0-cp311-cp311-macosx_11_0_x86_64.whl (56.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyramids_gis-0.20.0-cp311-cp311-macosx_11_0_arm64.whl (50.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pyramids_gis-0.20.0.tar.gz
  • Upload date:
  • Size: 422.7 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.20.0.tar.gz
Algorithm Hash digest
SHA256 ba4f9af4ba07e87ca47f341f3868d3ad4d4a92662a5e02922a1cedd04a392cc9
MD5 b709f9740d69a06c7a1787d412f57bd9
BLAKE2b-256 c7456c61cd196977c21dcef712e2c7462ac883e612ca4c61a717c8ed4843c198

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 6a76ede2a424ac7c1459cba4aa21ce8f2077802ffddbbdc8c41f5d6667c02054
MD5 7a1bbe785ccbb0f3863654883e8dbffa
BLAKE2b-256 9b6c633fa630f52e79cb5d75391859aef735b2272d8232005c50992fb6f6b556

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 8f6b4fe1d51a6b982ea432b2fe8a450da23f43e0be381fd0a5e57699a8ea8c03
MD5 84808e049ef8bb6de4c75e57e317e399
BLAKE2b-256 1e257235bdefcb761f0c3719f24f3ea812fdfc42a4efaebb68e92e4ca912df18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 47a2c9f75c0ba5d93d58e511a497f1e8f884e35460fad8cb67de4f2dd8019439
MD5 2de798cf029234d56c650c3397690719
BLAKE2b-256 b27d630b3400de09bb7fff9815e754c1ad077c993915741a0454cda8de9dafeb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9e84f5ad865641706e311320adabab923cd46776e62c0ebb8d5fbfe85f2926d8
MD5 901d7324730859307ff1c796222c3abf
BLAKE2b-256 f877684eeea74e9bb2010dc4303157eb972952c6b0eb5d59720f4f42b7bc30db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 076afa4a017e038a318bc2f1751b2603869d28cc2128db82b757a703e81da2af
MD5 61826745dd756804d83728dac8a92a4d
BLAKE2b-256 3375aafd66c40e0df849fc11e1f27cc7f019e024789899d63a113ba72a0e5de7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 27377bb264842941874e1508eb0549b1b97db79c624db5109670a30cdcfdc7eb
MD5 3bce8ff88b6621568a6b03132d0483eb
BLAKE2b-256 a4a3153df43b148b9b9e0fe7161ac390dd10dee912eb920abb661b38f80ad5a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 49acd4ac4c40ba6800297641e970f314d530900b9ec77f603cac8c2f1580bbd2
MD5 5a00c0a6f13462a4bbbe5a4c2c1a1930
BLAKE2b-256 50db1e3c05ae5b74ba5bcc458862392e80e69414e824eec0ce74ab68e0dd114f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 b60dea5acac3e9558558585a68b9bff0b039d6772785972f35bf6a4f49c82da2
MD5 1973bd6676704dc0e4d7b28e402bb040
BLAKE2b-256 d379653a0ddfe17ec522455f927f61fa6531115cf7c7b6444a692a09c80c5f85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a9793f10f653b77089e0cd1b9df372afd783ed0d91c7597e524ea447c1e5f652
MD5 3e05f921d4d43c6e15bface25de694b6
BLAKE2b-256 ee97d27f24817320af541275b4534714a56dacacc8df2efff17c375c9f2547f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e8bf3ac1fc2ab103f54bd0d355890a79af85dd1172f00d2256da557681abed9
MD5 1acf06a2d663629b0a61849642a9a282
BLAKE2b-256 e8e32224e54eea9732f85064b148b11bf90a83c22494bcf262e6b0e0d6263910

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6d3b616b1632e250840987295f8cf80269b85cf473ed28696024f643faba8fde
MD5 4a392870ae47e0c061adf31ddc406393
BLAKE2b-256 0dd6aff351242344f4f1287d2906671f3951ad957e1ec02cd69f18834961628d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 2f575c10dae108634f7d6a6ec5ad0f2a8437def78dfe101773c59d4ea13d70a2
MD5 7f70223951e495336f665c01d1057db3
BLAKE2b-256 233a46ad68b23c250bd556f9153e882eae4515a7babb3e2a588dc1f66eb9b127

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 136fdfd996a9aa9e8741d2a02fa6e20110cce3ca125b81b95ec30caed11be2d6
MD5 3c45533e2c1b880383a9562911d56179
BLAKE2b-256 3c0f05ab46d4bde470783e1abd904aadc6e927178a60ad98ef0a382493f613e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 5c1d97d1499d7b535a4f1def6f7f2961c2bdc989eefc5e5037bebb40f8dbf06f
MD5 dcd0f7f475b0afde9993f0a7c1e25fc2
BLAKE2b-256 25dee31fdaf37d641a77259aefae1c270d833e4f6041f371cce48329d950260c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4f99f4a20892c61e405865958b8ac60ab8da9a029aa568df0c1337e5b8f2ac56
MD5 94602336b8954011ce0d0a8f538aa430
BLAKE2b-256 d8bfca98e506623d70ff7cd917ade849122280a6174f95afaf84a53a8f6bd0b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d7ba0761e1d27ad00d3eed2bf6a93a4f987018118484536b38cd6697f442dbfc
MD5 50d4330c5df3969ae005dce0d03d6664
BLAKE2b-256 8f9920cc86195e77e380c04a92bd9241430a6f6fc2e3fdbc3e90581bd15c3648

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c81c4674c8776057520db0b7d1658a71a936961249499721ff7b0bb723dc6f41
MD5 e404d097e2da9ef0d711d8f9d0504a76
BLAKE2b-256 449a20d37adb877baa414531db387582c21a2f8ae864b6b6383cc50fe0a6cd20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 82e8cd76739389fb0d0dfd600059da7bee73219c1c5ea5ad1f3195d6eaa2d8cc
MD5 f32160adb1f440920cf3a98106997541
BLAKE2b-256 5a55906665f06137d959ff9155623314a9a417156efdf437b1538799557cdee6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 fc6fab159c4d5f05dde1ef49c0c4ef8d76124d838ec1d6048e424ea9a683a19f
MD5 7520ce7df75bf3aa0c96cfad1d6a1897
BLAKE2b-256 c127301de05cf717b27a6c8967b953bbbf3a0ab91b5d0e60800e95f64e791499

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.20.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f87b419217fa79b250d26f01b1030198e3052fa422fba2bd41003c605a489c80
MD5 994382f94f6250698b076d2cac498824
BLAKE2b-256 f314b6567f1ab2461bb1257e8426e888d9d0da3f092262835aae5bb3a459a9d2

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