Skip to main content

URaster: Structured Raster to Unstructured Mesh

DOI License

PyPI version PyPI Downloads

Conda Version Conda Downloads

Binder

geovista

Overview

URaster is a Python package to convert structured raster datasets into unstructured mesh structure, designed to bridge the gap between structured raster datasets and unstructured mesh-based hydrologic and land surface models. It leverages GDAL/OGR for robust data handling.

✨ Core Features

  • GDAL-Native Vector Handling: Uses the standard GDAL/OGR engine for defining unstructured mesh cells, and performing projection-aware geospatial operations. It also support mesh cells that cross the International Date Line (IDL).

  • Standard Vector I/O: Instead of directly operating on various mesh standards, it utilizes standard geographic information system vector formats (e.g., GeoJSON) for mesh operations, ensuring broad compatibility. It supports transformation APIs between existing meshes and standard vector formats.

  • Projection-Aware Operations: Handles (raster dateaset) map projection differences to ensure accurate aggregation of raster values within each polygon.

  • Interactive GeoVista API: Offers simple functions to visualize the input and the output vector layers on a 3D sphere.

Static visualization of the unstructured mesh on a sphere using GeoVista: Unstructured Mesh Visualization

Animated visualization of the unstructured raster on a sphere using GeoVista: Unstructured Raster Visualization

💻 Installation

URaster requires GDAL for vector handling and GeoVista (which relies on PyVista/VTK) for 3D visualization.

⚠️ GDAL Note: Installing GDAL's Python bindings can be complex via pip due to platform dependencies. We strongly recommend using Conda for a stable installation of GDAL and all dependencies.

# Create a new conda environment with uraster and all dependencies
conda create -n uraster_env uraster vtk=9.3.0 -c conda-forge
conda activate uraster_env

This single command will automatically install uraster and all its dependencies, including GDAL, numpy, pyearth, and VTK 9.3.0 for visualization compatibility.

🚀 Quick Start

Quickstart documentation

Example datasets are provided through the GitHub repository: URaster Example Data on GitHub. Please refer to the README in the data repository for details on the datasets and how to use them.

If you want to run the example notebook in this repository, the input data will be automatically downloaded from the data repository when you run the notebook.

If you want to run the example Python code in this repository, you then need to download the input data from the data repository and update the file paths in the code accordingly.

Tutorials are also provided through the GitHub repository: URaster Tutorials on GitHub.

📚 Documentation

📊 Supported Formats

  • Mesh formats: GeoJSON, Shapefile, any OGR-supported vector format
  • Raster formats: GeoTIFF, NetCDF, HDF5, any GDAL-supported raster format
  • Output formats: Vectors (with computed statistics), PNG/JPG (visualizations), MP4/GIF (animations)

🧪 Running the tests

The test suite runs fully offline (no data download required):

conda env create -f environment.yml
conda install -n uraster -c conda-forge pytest pytest-cov
conda run -n uraster pip install -e .
conda run -n uraster pytest tests/ -v

Network-dependent workflow tests are deselected by default; run them explicitly with pytest tests/ -m network.

🔬 Research & Applications

uraster has been used in research and related projects:

🙏 Acknowledgments

The model described in this repository was supported by the following:

  • the U.S. Department of Energy Office of Science Biological and Environmental Research through the Earth System Development program as part of the Energy Exascale Earth System Model (E3SM) project.

  • the Earth System Model Development and Regional and Global Model Analysis program areas of the U.S. Department of Energy, Office of Science, Biological and Environmental Research program as part of the multi-program, collaborative Integrated Coastal Modeling (ICoM) project.

  • the Earth System Model Development and Regional and Global Model Analysis program areas of the U.S. Department of Energy, Office of Science, Biological and Environmental Research program as part of the multi-program, collaborative Interdisciplinary Research for Arctic Coastal Environments (InteRFACE) project.

A portion of this research was performed using PNNL Research Computing at Pacific Northwest National Laboratory.

PNNL is operated for DOE by Battelle Memorial Institute under contract DE-AC05-76RL01830.

🤝 Contributing & License

We welcome contributions! Please open an issue or submit a pull request on the GitHub repository.

uraster is distributed under the BSD 3-Clause License.

Metadata

Release files for uraster 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uraster 0.1.9
File Size Uploaded Provenance Actions
uraster-0.1.9.tar.gz 81.4 kB Without provenance Details for uraster-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uraster 0.1.9
File Interpreter ABI Platform Actions
uraster-0.1.9-py3-none-any.whl Python 3 none any Details for uraster-0.1.9-py3-none-any.whl

Total release size: 149.1 kB

Release files / uraster-0.1.9.tar.gz

Download URL uraster-0.1.9.tar.gz
Size 81.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d3519b21ac6bc9fa770714f5f27c64a1e66f09aefc32ba0a31bfbf5ef12e39a9
BLAKE2b-256 checksum
How to use checksums
047a783efeb124d856d5d0758546153d27eb69f8bb5fa5a6bcb56e2841fa920e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / uraster-0.1.9-py3-none-any.whl

Download URL uraster-0.1.9-py3-none-any.whl
Size 67.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34682aa3fe0ed6ee142c5a087b4e23dacacba1e7e0a21b98bce48390fde5b1b2
BLAKE2b-256 checksum
How to use checksums
f7ee58f182ab9dc760dbe44b99cfbcda26fab6b6c65163e07b05a501003c17cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for uraster 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page