Skip to main content

Raster and shape tools

Project description

RasterToolkit

RasterToolkit is a Python package for processing rasters with minimal dependencies. For example, with rastertoolkit you can extract populations corresponding to an administrative shapefile from a raster file.

Setup

Install from github:

python -m pip install .

Getting Started

A typical raster_clip API usage scenario:

    from rastertoolkit import raster_clip

    # Clipping raster with shapes  
    pop_dict = raster_clip(raster_file, shape_file)  

See the complete code in the WorldPop example (examples/worldpop)

A typical shape_subdivide API usage scenario:

    from rastertoolkit import shape_subdivide

    # Create shape subdivision layer
    subdiv_stem = shape_subdivide(shape_stem=shape_file)

See the complete code in the Shape Subdivision example (examples/shape_subdivide)

Running Tests

Install additional packages (like pytest)::

    python -m pip install .[test]

Run pytest command::

    # Run unit tests (recommended during development)
    python -m pytest -m unit -v

    # Run test for a specific module, for example
    python -m pytest tests/test_shape.py -v     # run shape unit tests
    python -m pytest tests/test_download.py -v  # run GDx download tests

    # All tests (before a commit or merging a PR)
    python -m pytest -v

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

rastertoolkit-0.4.5.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rastertoolkit-0.4.5-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file rastertoolkit-0.4.5.tar.gz.

File metadata

  • Download URL: rastertoolkit-0.4.5.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rastertoolkit-0.4.5.tar.gz
Algorithm Hash digest
SHA256 b7fd73475f05bfbc5e4aca213a5856d43b610163dbf06d0371d868c6f8d245eb
MD5 d29e99524e2df7fc8d5ad6168530b3ac
BLAKE2b-256 3dcae034ccbdf18ee50e282ed4e98efdf7e2deaae1db756e0d4bf75e929c03cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for rastertoolkit-0.4.5.tar.gz:

Publisher: publish_pypi.yml on InstituteforDiseaseModeling/RasterToolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rastertoolkit-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: rastertoolkit-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rastertoolkit-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d0af82671a0b5f19eee910c190da4201040a8915a7f10687e53b02bbe03838b9
MD5 1234de2b9948aa88573f86dd76df54c8
BLAKE2b-256 627cb01f7b92b41ae2792c1840b9902a587520478a6b51e096051dffa5f80737

See more details on using hashes here.

Provenance

The following attestation bundles were made for rastertoolkit-0.4.5-py3-none-any.whl:

Publisher: publish_pypi.yml on InstituteforDiseaseModeling/RasterToolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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