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 test for a specific module
    python -m pytest -v tests/test_shape.py

    # 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.9.tar.gz (18.3 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.9-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rastertoolkit-0.4.9.tar.gz
  • Upload date:
  • Size: 18.3 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.9.tar.gz
Algorithm Hash digest
SHA256 9b26f998ce90d2665207c16c35e81f378edcbfaca6bd11e02b1bbfdd6e7391a5
MD5 faf6a822bbef64cb2b9ae5491e7fed08
BLAKE2b-256 eec9d54250a5a97d8a5c70ed500d3605158cde1cf5b091ebb2ecad7e6df98b99

See more details on using hashes here.

Provenance

The following attestation bundles were made for rastertoolkit-0.4.9.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.9-py3-none-any.whl.

File metadata

  • Download URL: rastertoolkit-0.4.9-py3-none-any.whl
  • Upload date:
  • Size: 15.2 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 fd9d804902ac48fca36405dad3c63ac9d2aea9336d27115d8bac9410fd0c40f3
MD5 db480da38d8c4c7f156dc029a6c057e7
BLAKE2b-256 32e361aa63c3ea04fce1a578432d5c368cf221032afba13fdb4973c8eae731c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rastertoolkit-0.4.9-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