Skip to content

GIScience/naturalness-utility

Repository files navigation

Naturalness-utility

Small utility with the functionality to return spectral indices (e.g. the NDVI) derived from remote sensing data.

The structure of this project is similar to the LULC Utility.

Indices

NDVI

The utility returns the median NDVI [-1.0,1.0] over a user defined time period within a user defined area as GeoTiff raster via the raster endpoint. In addition, an aggregation of NDVI values to SimpleFeature geometries is possible via the vector-endpoint.

WATER

Returns a basic water mask derived from the Sentinel Scene Classification Map (SCL). A value of 1 depicts areas covered by water in most of the images from the time range looked at.

NATURALNESS

This is a combination of NDVI and WATER that sets the output value to 1.0 for water-pixels.

Development

Setup

Poetry is used as dependency management. Initalize the environment via poetry install which installs all dependencies from poetry.lock file.

Note that the repository supports pre commit hooks defined in the .pre-commit-config.yaml file. Run poetry run pre-commit install to activate them.

Run

  • Copy the .env_template file to .env and add the required credentials
  • Run poetry run python app/api.py to start the utility

Docker

The tool is also Dockerised. Images are automatically built and deployed in the CI-pipeline.

In case you want to manually build and run locally (e.g. to test a new feature in development), execute

docker build . --tag repo.heigit.org/climate-action/naturalness:devel
docker run --rm --publish 8000:8000  --env-file .env repo.heigit.org/climate-action/naturalness:devel

Note that this will overwrite any existing image with the same tag (i.e. the one you previously pulled from the Climate Action docker registry).

Releasing a new utility version

  1. Update the CHANGELOG.md. It should already be up to date but give it one last read and update the heading above this upcoming release
  2. Decide on the new version number. Please adhere to the Semantic Versioning scheme, based on the changes since the last release.
  3. Update the version attribute in the pyproject.toml (e.g. by running poetry version {patch|minor|major})
  4. Create a release on GitLab, including a changelog

Packages

No packages published

Contributors 2

  •  
  •