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.36.0.tar.gz (697.6 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.36.0-cp314-cp314-win_amd64.whl (37.5 MB view details)

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.36.0-cp314-cp314-manylinux_2_39_x86_64.whl (50.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

pyramids_gis-0.36.0-cp314-cp314-manylinux_2_39_aarch64.whl (49.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

pyramids_gis-0.36.0-cp314-cp314-macosx_11_0_x86_64.whl (46.9 MB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

pyramids_gis-0.36.0-cp314-cp314-macosx_11_0_arm64.whl (42.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyramids_gis-0.36.0-cp313-cp313-win_amd64.whl (36.4 MB view details)

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.36.0-cp313-cp313-manylinux_2_39_x86_64.whl (50.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

pyramids_gis-0.36.0-cp313-cp313-manylinux_2_39_aarch64.whl (49.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

pyramids_gis-0.36.0-cp313-cp313-macosx_11_0_x86_64.whl (46.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

pyramids_gis-0.36.0-cp313-cp313-macosx_11_0_arm64.whl (42.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyramids_gis-0.36.0-cp312-cp312-win_amd64.whl (36.4 MB view details)

Uploaded CPython 3.12Windows x86-64

pyramids_gis-0.36.0-cp312-cp312-manylinux_2_39_x86_64.whl (50.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

pyramids_gis-0.36.0-cp312-cp312-manylinux_2_39_aarch64.whl (49.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

pyramids_gis-0.36.0-cp312-cp312-macosx_11_0_x86_64.whl (46.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

pyramids_gis-0.36.0-cp312-cp312-macosx_11_0_arm64.whl (42.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyramids_gis-0.36.0-cp311-cp311-win_amd64.whl (36.4 MB view details)

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.36.0-cp311-cp311-manylinux_2_39_x86_64.whl (50.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

pyramids_gis-0.36.0-cp311-cp311-manylinux_2_39_aarch64.whl (49.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

pyramids_gis-0.36.0-cp311-cp311-macosx_11_0_x86_64.whl (46.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

pyramids_gis-0.36.0-cp311-cp311-macosx_11_0_arm64.whl (42.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pyramids_gis-0.36.0.tar.gz
  • Upload date:
  • Size: 697.6 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.36.0.tar.gz
Algorithm Hash digest
SHA256 a39692d56bf02732cdd3915472809c10b5429cd4fd78ab1bc99f7c010046d175
MD5 a40ea3c42bdd068a5b4ca00fe91c2975
BLAKE2b-256 73b78109aa41179fcc7c7fea6472c2ab79b0bd0e266fcc212e9c939b557a11e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 48339f310b258b178d9ee6defe08c5046322b15c2a2fa7aa01aaeebdced51056
MD5 0e68c9c3e3e452164bb875f1ed6ef4b3
BLAKE2b-256 b27c6f93ddcd2beffbd26f2d312c5b138598f67191a4b0c480217ac9ef5adbcc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a9c09ec2890e6df9ca1e7170a5663825240fef91170531693f34833049d85ded
MD5 a4bf5c8d17874a30fb40412c1fc477e4
BLAKE2b-256 fb39c9304f1fc896e3af5cb79068145c18ac9314a673e37f1b3ea910dce0d4f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 9613dcb9fa92b32c33178e11a1a9b486998af936fdbe9538bcad14d22d6f6b60
MD5 a528ac0fdaee4413e7987a807d374e68
BLAKE2b-256 a863748f567092629ff0d3cb8d8dd1994b0dbe079d44bbd3dddc2e15cf8d3fb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 d346a236d46b4625ba8ea0c6e909f8f270899de96509256dc031d6737d4e915e
MD5 d7546cb6da50af674e342b6d1d8c5059
BLAKE2b-256 c89ecb69ac7404a2c2ea09dc9516159cd2f790282c97544c044cc2206196ae25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fa63696857d41386533b264a006e196823bce3f3c0b95ff3a6b3815ec604da95
MD5 37151cca9cec9d87e8129b65b14c161d
BLAKE2b-256 91cdbf8b1627c29f13ff67dd915682647aab1a0c618c7386ada5f9395e9e6b72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 238557fe59dc7be820785f42826140e0120e78355a1dde1b766fdc2b1118197d
MD5 c0251c1c4e6692a7c4d8e7fdd14c3882
BLAKE2b-256 b004b3cdfe52278253c4fb118dc807045b2d0eb1ef948c686871bb33d99d31da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 2adf617fa3ba4972065d4a9fc0b2d80501f6dcc67bc4722bdfb6e613c642b509
MD5 6328e565e7f89b5ca6f3705b71972d00
BLAKE2b-256 7d3b0e336c26c94fcd19773e30272385fa11c9080e3350b6efed5d6cefe7dfaa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 af071dc44361c1a5123a7e28f575b9191190a555949758ae19ba8d60691c6ba4
MD5 8f6f2d33248f95cbff9cf9cf50c67ef8
BLAKE2b-256 1f43902c565771a28216f72c8844d1874cc03b6585305141da168a4cdf0004c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 b63ff30195829fb805317b0339276e621cc4767ac53b2c1819f903f1fa562818
MD5 703cc78af0563edca17ff16cb98ca602
BLAKE2b-256 bdbd87ccf334f57a15d4d9c9ed6e7f8d6119bd79ca70e5fa7be88740721546cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 38aefd058b7001815a479846b8db31dcd0d8599237d448a4200cbbe15bab7d4a
MD5 dd2f0892564128bdc08c21e1ac22eba5
BLAKE2b-256 8302f857bc9ad2eb84cbfb28a35f57ae56bdfe914c095b1f7c851052dc13c991

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 26defe561de003cd197f5fac9089ff300713af3fac165dc1097a947728986731
MD5 4d99caadfed9e4a6c15c908dc3ecb0f7
BLAKE2b-256 2c4f573396fb4cc87b05b7ef3e40f12dbfc65112dbc6ea9e66f1e5a6761d6036

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 dcb37e5b54a9ffa8dd4b13c1fca16c45d8ecc4c73af21e87c4697fd2de3e5b11
MD5 4951f7f2d03996283a417bc812008f0e
BLAKE2b-256 e4d0c4fc0b1a4524085a6e9b892406ecb1f9b03b9cae72ac4a724e1ec9e25bdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 2e02ab1d074a095321a977fa37b5a4f8c8a3f929d212a18c11ce7625fefaaf2f
MD5 dc1c6e331b08874d129cfb44cdb10c2e
BLAKE2b-256 2968d5c6b025df7c4cfd9a4b954850fd12e73f59cfd9c0cfa54df333046e9384

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 df0b7d2329b5170e183a347f955690139507508f4f9e52ea69000a4e75353987
MD5 f51dd4d7e1bc3541b0b698874c82a342
BLAKE2b-256 e7ea9a69c9e709c119992cafdb9f974e401c452502fe5ed141f6bddbd77847e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 124dfd0fdbe678b78e012d89fc2b155772ab504a735783163f959f3e7d168762
MD5 b57972fd34d7df3063e26b46fe4d4cf0
BLAKE2b-256 7513567500bad1b156c3a564f935a855e2a667f21bd67a0fa31d1992c21f112c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ecc4beb7d3eb9c9d15595c3a236ff19a7caeb651a2970405f865f3f7d060c342
MD5 dbd28ee09b07c93e958749087a556aec
BLAKE2b-256 bfd21ff8f841b5fe643df3bd39d64d59a4becad1f8c9a08bac8411630ef092ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 2116f2c3e35a812b3958e7d609c71ae7bd39dbcc9474ffddc029fe527c5f5009
MD5 27a756c23a8267ef01ce5b953e8bac3c
BLAKE2b-256 99e0bec36d36467a8f3ae0b074d7c90bd2ea9116971c944d8c027ab0928e0c29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 ee4e279a621060c19c6be1672e617950f966ee5685559090a424cf11cb660803
MD5 65d7132084fd837364091b43cad27089
BLAKE2b-256 d494fb1fceb9a72a5df7536b57c70af49a779f1c5412a74fc9727609c3cbfc08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 189d1b587f90f9305d9f52095ffb6d5d155eec51b4748074f554292d7e25ff62
MD5 7e7282acaab075ff1f197e1eaeb9fd80
BLAKE2b-256 d0e97c86486ea7b5aa5c0aef18ed3d140f7b54659e5f262e39d458b440cb0bbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.36.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd764029ef843adedce2d200397a3508f1a53ee55ed51276367bb2fba15111e4
MD5 c9f77725d66ff508f1d7bf090971b93f
BLAKE2b-256 8b862e2cc8ff72e81b59147a1c013ed475614f95555eda2c83e1f79f7e45f484

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