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.6.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.6-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rastertoolkit-0.4.6.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.6.tar.gz
Algorithm Hash digest
SHA256 7cfefdd4f37567ae8580863cd48ec1e859dbb3614246ca1fa92e03e3a35641b8
MD5 84a82c8154745a05bcaa7f7a18d87499
BLAKE2b-256 3476c1e23c376b14d05e77874fecea5e1d7d6ed48f7b84b8e78fde56c965e9dc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rastertoolkit-0.4.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5ab67dbf7091fc3023e2aa6deb177f1f99ef1bb624cf0230777af98d69dcfbbf
MD5 68658afe58269a55051185e63fcbab3e
BLAKE2b-256 eb3f2ee03ff67b213da62e3a161e67fdbb7677d1788acff1612edc0f8f5252c8

See more details on using hashes here.

Provenance

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