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

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.33.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.33.0-cp314-cp314-manylinux_2_39_aarch64.whl (48.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

pyramids_gis-0.33.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.33.0-cp314-cp314-macosx_11_0_arm64.whl (41.6 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.33.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.33.0-cp313-cp313-manylinux_2_39_aarch64.whl (48.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

pyramids_gis-0.33.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.33.0-cp313-cp313-macosx_11_0_arm64.whl (41.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

pyramids_gis-0.33.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.33.0-cp312-cp312-manylinux_2_39_aarch64.whl (48.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

pyramids_gis-0.33.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.33.0-cp312-cp312-macosx_11_0_arm64.whl (41.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.33.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.33.0-cp311-cp311-manylinux_2_39_aarch64.whl (48.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

pyramids_gis-0.33.0-cp311-cp311-macosx_11_0_x86_64.whl (45.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyramids_gis-0.33.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.33.0.tar.gz.

File metadata

  • Download URL: pyramids_gis-0.33.0.tar.gz
  • Upload date:
  • Size: 616.3 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.33.0.tar.gz
Algorithm Hash digest
SHA256 f525b0a6e33d32d9582606b8ee49607a245c3724b9f5e75652c8526df430da9a
MD5 2a1646facb3cdd2ebbe22a46143c3119
BLAKE2b-256 cd2edf95b3374a00901f26dc8f1851b55d3298119e2cd1e768f1cf740cdd4818

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 825b49e7f4567e22a53a579b0a3c7b1dc108e983c723582356404a723a0cf7f4
MD5 2da9fe412161cf228082fd14bfb415fe
BLAKE2b-256 4fc3b49fae184eeba583b4b436e327a32a4893825d99a81fc6ee800972e24e82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 23c957b84c8a69cc65840539aeb3eedd49d8a131fd6c085d8120d917b503741e
MD5 af85587da0660fc8e0ead22d5d8b018b
BLAKE2b-256 cda958950ed3cccb8d6043ed70e2a6535521d0ba26bc34c8990eb209af5b44f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 afc51b4d72ab93b9f7100d511014cf54cb5d475115360192a423fb8bb9357193
MD5 8f8fdde73c4a513fa3e21588099e3a48
BLAKE2b-256 f1f3f646b7bbaff21ffdafa2b0b92bc43b2125b19d7cdc2cfc8a5acef5e750ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 2ada95642c3d6a6bcbc312711a0c5ffb4396be9664bba4582cd0bc8cc9e2f62f
MD5 ca2d16a7c6f2669d50bf296fc6906017
BLAKE2b-256 7e1955be4c9d46dc8dc5be5d5b3f2df2afa3316c9372d27f445575ba1f3bd833

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c8231067222bd9a4403b851b7e073df882cdc706ba77a85b039c5245b97b06ae
MD5 83afa36d2743472a8249362a43b3bf9d
BLAKE2b-256 d73b4a0aae0fcd1a89ddd6115d4f25d7c6b75fb417f0a4c4fb4e0657e5186f31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 23e76d17a402101ec60aca8aebfe984fecb8546b251e02b5fc5ebe82eb8e5765
MD5 69c6917d038ffa9ca2587d27eede8e5b
BLAKE2b-256 8605dfdf90fdbaeb880ffa19596333539cc45a3084de4f622297a3d9fa07be68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a505e45201a465cd0fd2fab3f70844e65b16c2f38009883075ca773ae94a6cf6
MD5 a6cd968625e5edd60995df0a70c1eae4
BLAKE2b-256 cb4656b2a9c2a2397fa3c2b85117d6a8280b29abbc8a86e79012c072b87d908f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 727ec33d2e8e80867e8240c1f878d653a77c1c547f5a3210a92ee9d94e911332
MD5 078ba585cb5fc07afa226bcd418d1f75
BLAKE2b-256 8a56b23a6d1c970f4b5faed24dcbb7735c5967f42b10276d3ce3cfa821f7db14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 f0d7e2f84b5a5a6713e04f3b936da960051497b2bfa9fbaff64d32ab1c5d1e95
MD5 e9d7eb7107b9472b8d5de6469076deb9
BLAKE2b-256 e28e38fcf96aebd067091e9aec0fc1137777258cbce34a80e43c5e55a63da4de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 97d96ca42d8c0149929db01e9509fcc823c363de20c9594cd0021b77e9201ee3
MD5 240fba4ff342911d5c3b2b54c0bb9cb6
BLAKE2b-256 9d77368d7201e7756fa7ea46f3087c224e6f95640311e797dba4374e2d6f093e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ea7adfc491ed56c2dd73a24ec4df5f949655d5bd58679acd903570933def3cb3
MD5 e0a46713867a7d820ebb7fb81e959fa8
BLAKE2b-256 91c73bc13b3835ab543751cb7843f6b1c8dcb5b45fc1c116b865cb53fdfd3378

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 151d4d8800aa05eaa3efb6fbfaefabc36d4b8e0cf6f9803e33ca1dfc011d039a
MD5 00bc72daf3b5e439bf476cfa593f20de
BLAKE2b-256 c1009215230db8245cd9cee9e6c7b8ed51d19e45b5dec20fef4992519ed5becf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 1e6c08266eeab1eee0437306c7d39937bc8030847cd4bb4223a56662efee96bb
MD5 fd2655e6c9cdcb59b265d5ad0dd960ae
BLAKE2b-256 058efe54147af06d1e62510a90db94e978fea71b7a07e3ae4937481ce4d9f23f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7a83920ddb3c36316559f33bdf1a9c8f3c0d0081f8376f74f5d092747438b326
MD5 306e0694090255e319f03c3f69416a95
BLAKE2b-256 6252579bd5cf62b1460228fc89d2274373db1576e9eb5b88aed9ddcbcba085d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 35d831e5397c7e292f1727f1c37204066de8bc6ce0942efbc61ad8de910a3a81
MD5 c8234f45b76cc7ee9744f47145b709c7
BLAKE2b-256 565fbd30513654f0e2382009247c3de2b615f0497c9a8779f3201351a25ec3b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6f348b3798698110ca618da1da8c63a0de5c964893173a4ba2a08fcf4de112bb
MD5 456b2800d23b58928f5cbe0d8fc831c3
BLAKE2b-256 27cc9e9abb33e70c5203329e1c96b3a47327818f083b4753488204eafe222e70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e5a7ce98bb960cf96d2ee0c56639987d81f4422d6f39a9b3798c2ce2dd8cc024
MD5 50bc37dbdf5bdbe8413784c0081c5891
BLAKE2b-256 e12df32f410b0b33a79089bb4c6e1a19a3b62d8cbbe3353ed5b5eefa872d870e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 a097e3b12bde137370fb36d44ef99271b09194617e2487e4ba6a2e9643277bc6
MD5 521292d460fc28f3fb91fe63c91faa3f
BLAKE2b-256 161bbff5e8013a3d29904cc1228963eb0956f7db8fb9e9d351a3ea39ee889368

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 21fa935d24bd7fc403768176ff30c691a0ba736701fdfaf941c42dddf82dbd06
MD5 8c034ce3c3c24a7e3a1be2d7c3251a2d
BLAKE2b-256 6b020123189c6f64f56072326abe3c7db3e5c3c4e8f5abb0d4cf0022de16e150

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.33.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b975fe3cbd60152c201c0a7ebd6c327f199230a138e30ebb2179e5a620226f7d
MD5 faa88ea9459a2802c0f633c5edafdec3
BLAKE2b-256 27be69df5abed4b2984df2cdee5978cf532f51bc725e54f8581f1f08a20d17ee

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