Skip to content

pjhartzell/raster-footprint

Repository files navigation

raster-footprint

CI Status Read the Docs PyPI

GitHub

Create GeoJSON geometries that bound valid raster data. Depends on rasterio and shapely.

Usage

pip install raster-footprint

Create or manipulate GeoJSON with the CLI:

raster-footprint --help
usage: raster-footprint [-h] {create,densify,reproject,simplify} ...

options:
  -h, --help            show this help message and exit

commands:
  {create,densify,reproject,simplify}
    create              Create a raster footprint
    densify             Densify a Polygon or MultiPolygon
    reproject           Reproject a Polygon or MultiPolygon
    simplify            Simplify a Polygon or MultiPolygon

Import raster_footprint functions into your Python script:

from raster_footprint import footprint_from_href

footprint = footprint_from_href(
    "my_raster.tif",
    densify_distance=100,
    simplify_tolerance=0.001,
    holes=False
)

See the API documentation for available functions and options.

Developing

Clone and install in editable mode with the development optional dependencies:

git clone https://github.com/pjhartzell/raster-footprint
cd raster-footprint
pip install -e ".[dev,docs]"

We use pytest for tests:

pytest

We use Sphinx for docs:

make -C docs html

Contributing

Github issues and pull requests.

License

Apache-2.0