Skip to main content

Agricultural field detection using spectral indices and threshold masks.

Project description

GitHub code size in bytes Code Coverage Pypi version

FieldFinder

Fieldfinder is a Python module for detecting agricultural development in 8-band PlanetScope images. Information about land cover can be extracted from the different wavelength bands in a multispectral image. Spectral Indices are combinations and ratios of the different bands, and can be used as features to identify land coverage. A common index for identifying vegetation is the normalized difference vegetation index (NDVI). The measure scales with the presence of live, green vegetation. The formula for NDVI is: $$NDVI = \frac{NIR - R}{NIR + R}$$ NDVI is the ratio of the difference of the red (R) and near-infrared (NIR) radiances over their sum as a means to adjust for or “normalize” the effects of the solar zenith angle. Live green plants appear relatively dark in the photosynthetically active radiation (PAR) band and relatively bright in the near-infrared. Thus high values of NDVI would indicate dense vegetation (ie: agriculture).

Note: There are many spectral indices besides NDVI (Agapiou 2012), and fieldfinder can be easily expanded to accomodate these.

Radiance vs. Reflectance

Planet Labs' analytic data products are reported in units of radiance: $W*m^{-2}*sr^{-1}$. This quantifies the amount of light captured over a given spot on the ground. This depends on the amount and frequencies of light that are reflected from the surface, but also on satellite altitude, time of day, time of year and individual satellite characteristics. To compare spectral indices across many images, radiance values should be converted to Top of Atmosphere (TOA) reflectance to provide an apples-to-apples comparison

Installation

pip install fieldfinder

Quickstart

fieldfinder is designed to calculate a spectral index (such as NDVI) from an 8-band PlanetScope AnalyticMS image, and output a raster mask that indicates where the mask exceeds a given threshold. The following example demonstrates how to create an NVDI spectral index from an 8-band PlanetScope image, and output a mask file with values of 255 where NDVI > 0.65, and zero otherwise. The output file is reprojected to lat/long (EPSG:4326) coordinates.

from fieldfinder import SpectralIndex

SpectralIndex.create_mask_file(
    filename = 'example_AnalyticMS_8b.tif',
    output_file = 'example_NDVI_mask.tif',
    threshold=0.65,
    out_proj = 'EPSG:4326',
    index_type = 'ndvi'
)

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

fieldfinder-0.1.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

fieldfinder-0.1.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file fieldfinder-0.1.1.tar.gz.

File metadata

  • Download URL: fieldfinder-0.1.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for fieldfinder-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b292fe9984eec8228cd516c1b51308924903c254a2f3e3d356b50c3d5fbc3698
MD5 92b61d0087ae6bf520039c8fde41993d
BLAKE2b-256 23983e3aca92948b595d1f1eeb259c59f50aedd4118245467b8ab807b52512ed

See more details on using hashes here.

File details

Details for the file fieldfinder-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fieldfinder-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for fieldfinder-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c703b40f9b0f25d658bac40addacb21b4ebeac045af1620394772d0c703dbbc8
MD5 021324b6a726f6268cd2aedb8429b705
BLAKE2b-256 b058e8230af23ddf30d6cf5d54537796b748d91d9b6fd3718777d57d1ef49a06

See more details on using hashes here.

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