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:
Note: There are many spectral indices besides NDVI (Agapiou 2012),
and fieldfinder
can be easily expanded to accomodate these.
Planet Labs' analytic data products are reported in units of radiance: apples-to-apples
comparison
The easiest way to install fieldfinder
is using pip
:
pip install fieldfinder
You can also install fieldfinder
from source. Clone the fieldfinder
repo. Go into the fieldfinder
directory and run:
pip install -e .
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. This can be used to indicate regions with heavy vegetation, such as agricultural fields. 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'
)
For a more detailed tutorial on using fieldfinder
to calculate a NDVI indicator for agricultural land use based on
an 8-band PlanetScope image, see the tutorial notebook.