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

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.23.0-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.23.0-cp314-cp314-manylinux_2_39_aarch64.whl (62.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

pyramids_gis-0.23.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.23.0-cp314-cp314-macosx_11_0_arm64.whl (51.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.23.0-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.23.0-cp313-cp313-manylinux_2_39_aarch64.whl (62.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

pyramids_gis-0.23.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.23.0-cp313-cp313-macosx_11_0_arm64.whl (51.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

pyramids_gis-0.23.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.23.0-cp312-cp312-manylinux_2_39_aarch64.whl (62.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

pyramids_gis-0.23.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.23.0-cp312-cp312-macosx_11_0_arm64.whl (51.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.23.0-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.23.0-cp311-cp311-manylinux_2_39_aarch64.whl (62.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ x86-64

pyramids_gis-0.23.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.23.0.tar.gz.

File metadata

  • Download URL: pyramids_gis-0.23.0.tar.gz
  • Upload date:
  • Size: 495.8 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.23.0.tar.gz
Algorithm Hash digest
SHA256 c893635ad1f95bc4a2833ee9024bce7f9f412caad527dc7c12dcb29289a0c46e
MD5 ea77568679f9d8610ea4a0d869d7c60f
BLAKE2b-256 b109786e00cda9758169756de821d9acde638bd0fc06628ff4f813b34236442e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 8e712caafe6f1d24f884c7b3050a2669d280119f07416e6ec0a55d58985af9af
MD5 d1da64141118905fca4f0af30dad262e
BLAKE2b-256 3a324fa55055e8736589cbc1a0941514f310eacaf122dadbe95de95783e5c7d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 89fb1a7117c784e182d378a116a9ada7acecdba9d070b9022381530a36150adb
MD5 2b8abd52cf9965cd1a4c1f0f974a94a6
BLAKE2b-256 6cd338590aa558bd3bf020d47f19e1f0a38dce6c3ca3afca7b0bffe6349331f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 401e6a5c35b91f3cbede58ee368643361252fe183ed7d88e485099d71eaa42b7
MD5 a0fa6fa241f50b7b650a0e98bfae81f3
BLAKE2b-256 805a794c26e380cfd15cbcc396c989868c8bf4f5ba05ef3ee3a3117cef1cc791

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0bb69d2e020be42a356fe7529b493a39ca9ab83f585cb779079da1d315d8fccb
MD5 96313823e44e3a10f02f7edea8c9cd0d
BLAKE2b-256 68d5e5a540060eb14de369cfd6a9e141a5a981a436fe670a0f688a391337b7f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c123735dd8993d10d65ff8d3772d268af34a6b4a780e8d9c9d5c1985183b68ab
MD5 c10948e5c1b0110195595bf676c4d74a
BLAKE2b-256 aa7f9988b504d835dd8f1ab5795fe934dfdb0968d01456214e4a793ec9f9da5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f3ccbdd3c0b7ab1c76a341bcebee7f47ea44e913a91a9608a058f977d9781922
MD5 eb192dc237b664e02d3dc36072f8ec1e
BLAKE2b-256 5594a81c2e79255f0312453286f938831c950fef79fa3f7655887e16da5dfb1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 254af7bf9f65e468ca5d7ed2051783f0abdba1aaf5948274c8c8efe12a1e1577
MD5 fe55a4416e444acfc98295181017dac4
BLAKE2b-256 d2212daa39aa11f163c9d1a1f0225428d24639440bde74064d243ad944bc0071

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 02898cfb4e10810ddefbac5192190a3a092052a98e4bf3edb740eb80bf74b40f
MD5 c444caa0764f67580c6a462844fa3903
BLAKE2b-256 a4a3fc99422fa13cdec5338b954adf9067a857aaf2efaefebbf18ea2859f3efe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 54719a10edfb943b26719bdfb81f569ac10fbb2d5034b479e10046a0951716fb
MD5 90e64fdc39874ac6c5ad7a553e2ab390
BLAKE2b-256 9a9536fb04922bdcfc696421f496df19864e121cc2cbe440a0ae20a70a47fd1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 15fb5be1e0a1da2dd625f7230ba62b137d7670bce4aedc3c812bd4a0d495cc48
MD5 b73df129dccd909a574483151b3656e2
BLAKE2b-256 723164a16b279e62e5ddc94359d03259a22f117fade4c95b3428a253306ec273

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c049c712a027c5117ae900af015fe1381fa6b96a1caf92bd0da8b804563adbe8
MD5 a900547833a67a47b7e2ff8b345ca0cd
BLAKE2b-256 4c04fe6ebf511ed011580d781f6907eab0b37747b9f85ad0a368548909d4b244

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1e0157d27f09244dec5173c464f0a7e86c70b9c7a33c0e015830cacd58c9277b
MD5 a9cef32acd7f2e94ea886b1d79b790f5
BLAKE2b-256 7359d665c8eb0502f17e5cb946feaf29eebad07f96147028f0634a8d7d2cafaa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 9522ac2bd63a405319d815755fe4f4f33c418570e59f960f7991c8041d2baa04
MD5 6db22627545e5ff26066933da3f5ed36
BLAKE2b-256 c2a845f4815dd1ee7214629f975b6196006c0eedce08929df7e17fa050e2617a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 23238285cf8568b1904bbc417d4d6def31def80750a477d468d47e1fa20c5fe5
MD5 087189993bc78037e242ec2f47af6fc6
BLAKE2b-256 90d022cefb9ee4e1801167dcb6e1092ef296f8996c655b148a9b974b19335024

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8353724d07a96d73e4640436bc53857bbc6aad83fc92a771d260ab8e095b0440
MD5 c28447414080bea6c64946b69d6baf4c
BLAKE2b-256 0e3fcf2b56833d43f89439c69f85bf8f4cfefa9f7313c5345b70cf9603c42dda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 600816fb22c2203301050588a9c54a3c3bde02b2b833da3ef5494bc4311df71b
MD5 fb62b003d6731e743ec524c4b64b9a54
BLAKE2b-256 241cfa02af84467a81b3452904596d8b8a9e7a7f1409c84f48a37c57cb07db06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 41c9d6bf039b135f46adebfb36759d7a9ec3bbdc963cf98198b43f6c874f92ac
MD5 ec8749ccce08dc4a09fd48e1798cbb03
BLAKE2b-256 133a52935a945dd23c459d11c09e8a02166690074014859a2987a36ddaf94592

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 282784122debc18d43331689692608c5a0e5ffe6a375895bef43a11e24ce7f84
MD5 62d7628a1e4651e5be94c4f14bed5ba5
BLAKE2b-256 5bb6b8a1eec7cc33eab1b2e88b3871e3b22ca52fba54d53ebcc45d7fc8dd476f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 8d235a6f9ff43169e3371c015401d3d7283e13e228ed615422396d5c6475bd90
MD5 734ce91d48dea5d0db9cf4ec62dd2e20
BLAKE2b-256 1d7e4e7175e546147f2f774978b627f8d761a72d66b328788258e4f5b5507928

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.23.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d012d294e9e619608e9b7aa5da1979cc6a984a415dec5ef8fbb2d119cec188bc
MD5 71971c79c35c140cc5b691a3ac0f9f7c
BLAKE2b-256 2d006a6d8c36b57d76045cc9b59e23c9e52fb230b35483bd28f991db706c4371

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