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

Uploaded CPython 3.14Windows x86-64

pyramids_gis-0.21.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.21.0-cp314-cp314-manylinux_2_39_aarch64.whl (62.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ ARM64

pyramids_gis-0.21.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.21.0-cp314-cp314-macosx_11_0_arm64.whl (51.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyramids_gis-0.21.0-cp313-cp313-win_amd64.whl (36.1 MB view details)

Uploaded CPython 3.13Windows x86-64

pyramids_gis-0.21.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.21.0-cp313-cp313-manylinux_2_39_aarch64.whl (62.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

pyramids_gis-0.21.0-cp312-cp312-win_amd64.whl (36.1 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

pyramids_gis-0.21.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.21.0-cp311-cp311-manylinux_2_39_aarch64.whl (62.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

pyramids_gis-0.21.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.21.0-cp311-cp311-macosx_11_0_arm64.whl (51.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pyramids_gis-0.21.0.tar.gz
  • Upload date:
  • Size: 460.1 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.21.0.tar.gz
Algorithm Hash digest
SHA256 7794bc7782d7fe627841e932642a1b60c62e11d0e663b3af2a1db9873fb15c59
MD5 c79b69234d536c653870c89917d78c67
BLAKE2b-256 74048d2fd5fc2327f6daf10f8b5c36946348a2bfb29539ec10120fd8ea57cd63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 cc9c3ed858c99d4572799432f9e68a39dbfd6711761e4a20c0bbfed8cc3ea334
MD5 336488f4b1aa03890bfb6af0bff1cbad
BLAKE2b-256 0f9bf50fc47ec7c73b93aadf75e33b44c01ed104c46ff747b389211866a6360b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ea47a7bd5a7ea2747e07f529638275de13fe01ebec979834b48213eb0e787a0f
MD5 75343fd6d4e6df27d8e9ddb2160b5287
BLAKE2b-256 2f9686a317e17f56277e0b30aa36494784314e3928ede539b692289f7fc3330d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp314-cp314-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 666a5ebcd9aa78cbbfc6453e44ef0a077d5e25ba5b92d1753406233f3a1ae472
MD5 8eb04d4650b419b8a3874741e2d78853
BLAKE2b-256 aff3f1328f63465384d39c5cbdcf9a5e28ba488b45617648bd4a80a3171ad7a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a5cbd614e1dfa11659624e0e6384b1dfbd79d0f1e4e1710ac539e4602b68ba1c
MD5 af937c7d0c7be0d93b753563013f4099
BLAKE2b-256 f1eaf9f48672b4e0f97c8e370db2bf4be808719f2f321291b8554c256faaae4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 93997438dc55e8c773f7528362314a368512977abc51e6401413e946d99fc926
MD5 27ed300162a109a7e21cac9649fbbbd6
BLAKE2b-256 81aa2ed5fed29207700b669b3ea663e12adf87f84cb5c750cb355bfd5accdafc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c30f91edd7933a7732d1161b97438c5fe8fe44022f281c958195440aa4c177d7
MD5 55a8d00d375958afbea5dd1b26a512a2
BLAKE2b-256 8ad47e19c7fad7344a89948322266a27f0332d370bcfe2f73ac46e2262213e57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 b9a4cfc221cbf82cd82a1abaf56c011bd55340ff76d2afc5cf79714e59dbf9c1
MD5 cbca0f58cce814446bfe5065f48d3e1a
BLAKE2b-256 6c65a4f369dae42304384a5e1f31cbf823bdc33f209383ef90d4fce49ae4a600

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 d091dc241d7e5fe3ee47c5773345a2e710675f697d7d9260fcb3365c045ee141
MD5 0c0eacfb89881c99310537bd0d617802
BLAKE2b-256 4ac442ac072a8b3a57c5e655dfa13d5cb20b0fda923744088083ead53ac87ed3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 72b0c7b2fc239411355f07b45239d3457f823094e9f12c8241077cd51f7dacfb
MD5 690c47159bd1048edfce2fc2dd835b0b
BLAKE2b-256 a99864a0f1f090fe403a175e80241ac662dd9b8ec8c5562cb0a318bd345a9afb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e87df778d7dd8618f95715872e6fa856f4e9588a39b86d5c522548e77a2d5906
MD5 a49584c091999a67e5a5ddfea4384b58
BLAKE2b-256 96cb5e5a6d44799acce68a5d3f2af7a8b836fdb061ddab85eeb69edc17ae04ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8ffb839a88ed0a3518eb973fc0824aa1914a4e7617ccd60a4e53bf8dccfd48b0
MD5 3485b0182c2ed004b83ff26784e0424d
BLAKE2b-256 34386c403b13b3b2e420560aa150e65c84fe82643957a591449b297f9ea77a09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 dba90e7fc19735feb29883c2a150df9f1273671ea9bdee2d3bd1edbc07808339
MD5 bae3a5b0eb53cfc1c582383b6a5f89e7
BLAKE2b-256 d0fc08fc047f9f04ebb69e09dcde15ae9663d2504647db38d0e5cea576462a61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 4ee0785aa04631786a4634b445fc705c16fdfaf1a068c397905ccae9672490af
MD5 d79c1bb02b2a204c7615bbe178c41666
BLAKE2b-256 9135e4489c54af46ccd7fdf9f23744887ffaa9bc09e62fe48dae2a3246011468

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 bc0c6432418baad5a3bf568af351c5cc1b11ddf36e86852b9fcf3f23dc31672e
MD5 b7903e5d186ef4cf2c7bba0d102b80ab
BLAKE2b-256 8baf587b70aa9fb2e2164a3ab69cfaec7a3cced9f24ea6b9193866ad772a6c08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31c978f2e88b378733c179a50076cf36c1292e0d3e451734133cb560ef62d6ce
MD5 1193929cf9bf36d9ebc9896bfcd55270
BLAKE2b-256 2024fe4ce79ab40008f0ff81b8c47e67d900f738650766ea98313b2006f72908

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6bd7516a0275a01453463bf2a4ce3b962d7b00afac852e602da4f3526f07889c
MD5 82c947890a042bcc839551905fc09c47
BLAKE2b-256 b2d63dee5bfacfdffffc781ed008c96d6692f9b86c865a7490e3561f138843b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 87efd611b3baba534c20f5050b24dbbce436f19b36dde8048ff9283e27322667
MD5 4b2c0cef72bfb09e2536d96f20122da3
BLAKE2b-256 8238e3b0d94965ee196ed110ba42389d21fcfa54dd0d01c643ac1e27fac89b34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 4367876a6ed83085f9ee996bbe411e3da78bbd333c5bfaebb8703a02c0a62951
MD5 299837c348c21763bf8d6bbc80a488a0
BLAKE2b-256 3ca02152ef9e94875b99c05b55327dc5abe2a1adc5c42a5d4182691713ad89d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 5b71fc8e1890071a9760e0fa385de2ee860e38f9f0829343a07ec9593fd38c42
MD5 6a3e8b96a87192ff450d249f4ad2d345
BLAKE2b-256 9fd15989911e95d129b7c1dd0a7d66fc4d5b9fb69f542ff8a45ef03b170bf2c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyramids_gis-0.21.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 707d38a2c547b5b11d9fa03736486ea4f853ed6ecfb0bc448440256d7db9c221
MD5 1a6a6835f0149cd74f74aa5441080f54
BLAKE2b-256 189f998ab34c5b739a599a715b3fde33daf5dd86dded8108771abde6f89d92be

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