Raster4ML: A geospatial raster processing library for machine learning

Raster4ML is a python package that extracts machine learning ready dataset from geospatial raster data and shapefiles. The package aims to aid geospatial researchers and scientists to extract meaningful faetures easily and focus more on the model training or reproducibility issues.
Key Features
Stack raster bands
Automatically calculate vegetation indices (supports 350+ indices)
Extract raster values based on shapefile
Clip raster based on polygon
Raster4ML works with raster data derived from satellites, airplanes or UAVs. The applications can be supported in precision agriculture, plant phenotyping, hydrology, natural resource management, and other fields within the geospatial science.
Here is an example of creating as many vegetation index as the image wavelenghts support by simply using the following function:
from raster4ml.features import VegetaionIndices
VI = VegetationIndices(image_path='Landsat8.tif',
wavelengths=[442.96, 482.04, 561.41, 654.59, 864.67, 1608.86, 2200.73])
VI.calculate(out_dir='vegetation_indices')
Introduction
Main Idea
Machine learning has been playing a key role in different domains of geospatial science, such as, natural resource management, hydrology, agricultural monitoring, land cover dynamics, and so on. Researchers and scientists often use raster data derived from satellites, airplanes or unmanned aerial vehicles (UAVs) coupled with novel machine learning algorithms to estimate physiochemical parameters or explain the underlying processes of different phenomenon. Geospatial raster data is different from natural images often seen in computer vision applications. For example, a common task in utilizing machine learning for raster data is to derive hand-crafted features based on different disciplines or research questions. Such features have can explain certain characteristics, which cannot be interpreted by the individual bands or channels. To date, there has been many vegetation indices or texture features reported in literature. Therefore, it is difficult for researchers or scientists to derive the necessary feature from raster data and extract the values for the sample areas of interest. We hereby propose a Python-package called “Raster4ML”, which helps the users to easily create machine learning ready dataset from given geospatial data. The package can automatically calculate more than 350 vegetation indices and numerous texture features. It can also derive the statistical outputs from areas of interests for multiple raster data, which reduces the manual processing time for users. On the other hand, the ackage provides supports for dynamic visualization of the geospatial data that can help the users to interact with the inputs and outputs. The package will assist the geospatial community to derive meaningful features from geospatial datasets efficiently and automatically. This will enable them to focus more on the algorithm development, training, and reproducibility of the machine learning application rather than the preprocessing steps.
License
Copyright (c) 2022, Remote Sensing Lab, Sourav Bhadra, Vasit Sagan All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Mapbox nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Installation
Dependencies
Raster4ML is built on top of geopandas, rasterio, fiona, pyproj, rtree, shapely, numpy, and pandas.
Virtual Environment
It is prefered to use a virtual environment for working with this package. Use Anaconda or Miniconda to create a seperate environment and then install the package and its dependencies there.
conda create --name raster4ml python=3
conda activate raster4ml
Windows
To install on Windows, first download the wheel files for GDAL, rasterio, and
fiona from Christoph Gohlke’s website (🤗Thanks Christoph🤗). Go to his website,
press Ctrl+F
and type gdal
. Download the GDAL file that mostly matches your
computer configuration (64-bit or 32-bit) and Python version.
After downloading it, cd
into the downloaded directory while the raster4ml
environment is activated. Then install using pip
. Do the same for rasterio and
fiona.
pip install GDAL‑3.4.3‑cp310‑cp310‑win_amd64.whl
pip install rasterio‑1.2.10‑cp310‑cp310‑win_amd64.whl
pip install Fiona‑1.8.21‑cp310‑cp310‑win_amd64.whl
If these three are installed, the rest of the dependencies can be installed directly
through Raster4ML’s pip
distribution.
pip install raster4ml
Mac OS
Has not been tested yet. 😕
Linux
Has not been tested yet. 😕
Quick Start
For a quickstart, let’s see how to pre-process a Landsat-8 OLI multispectral imagery so a huge number of vegetation indices can be calculated and visualized.
Import the functions.
from raster4ml.preprocessing import stack_bands
from raster4ml.features import VegetationIndices
from raster4ml.plotting import Map
Stacking bands
stack_bands(image_paths=['Band_1.tif', 'Band_2.tif', 'Band_3.tif', 'Band_4.tif', 'Band_5.tif', 'Band_6.tif'], out_file='Stack.tif')
Vegetation index calculation
VI = VegetationIndices(image_path='Landsat8.tif', wavelengths=[442.96, 482.04, 561.41, 654.59, 864.67, 1608.86, 2200.73]) VI.calculate(out_dir='vegetation_indices')
Dynamic visualization in Jupyter Notebook
Tutorials
Tutorial 1: Landcover Classification using Landsat 8
Datasets
The dataset for this tutorial can be found in the raster4ml_data
google drive repository.
Download the LC08_L1TP_137045_20210317_20210328_01_T1.tar.gz
file and extract in the
data directory.
Import Modules
Import the necessary modules.
import os
import glob
from raster4ml.preprocessing import stack_bands
from raster4ml.plotting import Map
from raster4ml.features import VegetationIndices
from raster4ml.extraction import batch_extract_by_points
1. Stack the Bands
First we need to stack all the bands together and make a multispectral image file. The mutispectral image will contain several channels/bands representing reflectance information from different wavelengths. Since the test dataset is downloaded from a Landsat 8 satellite, there are total 11 bands. However, we will only use the first 7 bands as they can accurately define most of the surface objects in terms of reflectance.
To stack the seperate bands into one image, we need to define the paths of all the bands in chronological order (actually any order you want, but remember the orders for future reference).
# Filter all the files that ends with .TIF
image_dir = r'.\LC08_L1TP_137045_20210317_20210328_01_T1'
# Empty list to hold the first 7 bands' paths
bands_to_stack = []
# Loop through 7 times
for i in range(7):
bands_to_stack.append(os.path.join(image_dir,
f'LC08_L1TP_137045_20210317_20210328_01_T1_B{i+1}.TIF'))
bands_to_stack
['.\LC08_L1TP_137045_20210317_20210328_01_T1\LC08_L1TP_137045_20210317_20210328_01_T1_B1.TIF',
'.\LC08_L1TP_137045_20210317_20210328_01_T1\LC08_L1TP_137045_20210317_20210328_01_T1_B2.TIF',
'.\LC08_L1TP_137045_20210317_20210328_01_T1\LC08_L1TP_137045_20210317_20210328_01_T1_B3.TIF',
'.\LC08_L1TP_137045_20210317_20210328_01_T1\LC08_L1TP_137045_20210317_20210328_01_T1_B4.TIF',
'.\LC08_L1TP_137045_20210317_20210328_01_T1\LC08_L1TP_137045_20210317_20210328_01_T1_B5.TIF',
'.\LC08_L1TP_137045_20210317_20210328_01_T1\LC08_L1TP_137045_20210317_20210328_01_T1_B6.TIF',
'.\LC08_L1TP_137045_20210317_20210328_01_T1\LC08_L1TP_137045_20210317_20210328_01_T1_B7.TIF']
# Use the stack_bands function from raster4ml to do the stacking
stack_bands(image_paths=bands_to_stack,
out_file=os.path.join(image_dir, 'Stack.tif'))
Let’s visualize the image using the plotting functionality of raster4ml
.
# Define the map instance
m = Map()
# Add the raster to the map
m.add_raster(image_path=os.path.join(image_dir, 'Stack.tif'), bands=[4, 3, 2])
m

2. Calculate Vegetation Indices
In next step, we need to calculate the vegetation indices from the stacked image. We can do this using raster4ml.features.VegetationIndices object. You can provide a list of vegetation index we need to calculate in the object, but the tool can automatically calcualte all the possible vegetation index rasters.
To do this, we need to provide the path of the stacked image, the corresponding wavelength values and an output directory to save all the indices as rasters. Since this is a Landsat 8 OLI image, we know the band wavelengths. The wavelengths can be inserted as either the center_wavelengths as list or the range of wavelengths per band in a list of list. The wavelengths has to be specified in nanometers (nm). The Landsat 8 OLI wavelengths can be seen here.
Optionally we can provide the bit_depth as a parameter. Since we know Landsat 8 data is a 12-bit data, we can provide this information to normalize the image values from 0 to 1.
# Define the VegetationIndices object
VI = VegetationIndices(image_path=r'.\LC08_L1TP_137045_20210317_20210328_01_T1\Stack.tif',
wavelengths=[[430, 450], [450, 510], [530, 590], [640, 670], [850, 880], [1570, 1650], [2110, 2290]],
bit_depth=12)
# Run the process while providing the output directory
VI.calculate(out_dir=r'.\LC08_L1TP_137045_20210317_20210328_01_T1\VIs')
Calculating all features
100%|██████████| 354/354 [01:44<00:00, 3.40it/s]
311 features could not be calculated.
The reason 311 feature could not be calculated is that some of the vegetation indices require bands with more wavelengths than the wavelengths provided in the test image. Probably using a hyperspectral image that has bands from VNIR to SWIR, could reveal all the vegetation indices.
3. Extract Values based on Sample Points
Locate the sample point shapefile in the extracted data folder. The name of the shapefile
is points.shp
. We need to extract the vegetation index values underneath each point in
the shapefile and store those index values for Machine Learning training. The shapefile
also contains label information. For simplicity, it only has two distinct classes, i.e.,
Vegetation
and Water
.
For extraction by points, we can use the raster4ml.extraction.batch_extract_by_points
function. This will enable extraction of multiple raster data at once. The function takes
image_paths
as a list, shape_path
as a string, and a unique_id
in the
shapefile which uniquely represent each point. The function returns a pandas dataframe.
# Find the paths of all the vegetation indices
vi_paths = glob.glob(r'.\LC08_L1TP_137045_20210317_20210328_01_T1\VIs\*.tif')
# Batch extract values by points
values = batch_extract_by_points(image_paths=vi_paths,
shape_path=r'.\LC08_L1TP_137045_20210317_20210328_01_T1\shapes\points.shp',
unique_id='UID')
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 48/48 [00:29<00:00, 1.62it/s]
6 columns were removed from the dataframe as they had duplicated values.
The VIs can have duplicate values because sometimes the equation will not end up with mathematical errors, but result in flat constant raster. That raster is not useful for any machine learning operation. Therefore the batch extract function automatically finds out those VIs and remove from the analysis.
4. Machine Learning Training
Now that we have our data ready, let’s build our machine learning model pipelines. We will
explore two machine learning models, i.e., Support Vector Machine (SVM) and Random Forest
(RF) classification here. Our target variable can be found in the point shapefile as the
Label
column. The independent variables will be the vegetation index values calculated
in the last step.
We will utilize functionalities from scikit-learn
to train the models. scikit-learn
has an automatic pipeline
feature that performs several tasks at once. Machine
learning models also require hyperparameter tuning to fine tune the model.
scikit-learn
has a fetaure for automatically doing that as well using GridSearchCV
.
We will employ all these steps at once using the pipeline.
Therfore install the scikit-learn
using either pip
or conda
in the same
environment and import the following modules.
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
from sklearn.pipeline import Pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
import geopandas as gpd
import numpy as np
# Read the shapefile to get the points shapefile
# Note that the rows of this shapefile and the extracted values match
shape = gpd.read_file(r".\LC08_L1TP_137045_20210317_20210328_01_T1\shapes\points.shp")
First, we need to split the dataset into training and testing set.
X_train, X_test, y_train, y_test = train_test_split(values, shape['Label'].values,
test_size=0.3,
random_state=42)
print('X_train shape:', X_train.shape)
print('X_test shape:', X_test.shape)
print('y_train shape:', y_train.shape)
print('y_test shape:', y_test.shape)
X_train shape: (70, 42)
X_test shape: (30, 42)
y_train shape: (70,)
y_test shape: (30,)
Then, we just need to define the Pipeline
, GridSearchCV
and the model to do the
training.
## Support Vector Machine
# Define pipeline
pipe_svc = Pipeline(steps=[('scaler', MinMaxScaler()), # Scaling the data from 0 to 1
('model', SVC())])
# Define pipeline parameters
# Note that we are only testing 2 hyperparameters, you can do even more or expand the search
param_svc = {'model__gamma': [2**i for i in np.arange(-10, 7, 1, dtype='float')],
'model__C': [2**i for i in np.arange(-10, 7, 1, dtype='float')]}
# Define grid
grid_svc = GridSearchCV(estimator=pipe_svc,
param_grid=param_svc,
cv=5, # 5-fold cross validation
n_jobs=4) # Paralelly using 4 CPU cores
grid_svc.fit(X_train, y_train)
## Random Forest Classifier
# Define pipeline
pipe_rfc = Pipeline(steps=[('scaler', MinMaxScaler()), # Scaling the data from 0 to 1
('model', RandomForestClassifier())])
# Define pipeline parameters
# Note that we are only testing 2 hyperparameters, you can do even more or expand the search
param_rfc = {'model__n_estimators': [2**i for i in range(5)],
'model__max_features': ['sqrt', 'log2']}
# Define grid
grid_rfc = GridSearchCV(estimator=pipe_rfc,
param_grid=param_rfc,
cv=5, # 5-fold cross validation
n_jobs=4) # Paralelly using 4 CPU cores
grid_rfc.fit(X_train, y_train)
Now that we have trained two models, lets check the accuracy score from both models. We
can directly use the grid
objects. If we directly predict from the grid
object,
then it picks out the model with the best hyperparameters and use that for prediction.
You can also go into the grid object and examine which model to pick and so on. Please
refer this link to learn more.
# Predict the test set
y_pred_svc = grid_svc.predict(X_test)
y_pred_rfc = grid_rfc.predict(X_test)
print(f"Accuracy from SVC: {accuracy_score(y_test, y_pred_svc):.2f}")
print(f"Accuracy from RFC: {accuracy_score(y_test, y_pred_rfc):.2f}")
Accuracy from SVC: 0.97
Accuracy from RFC: 1.00
Tutorial 2: Chlorophyll Estimation from UAV-borne Multispectral Image
Preface
The purpose of this tutorial is to estimate chlorophyll concentration of plants using machine learning. That’s why a multispectral image with blue, green, red, red-edge, and near infrared band is provided. A shapefile of some sample plots is also given. In the field, actual chlorophyll values of the plots were measured using destructive sampling. These can be used as ground truth for the machine learning model. However, to train a machine learning model, we need to extract remote sensing features or vegetation indices under each plot. We can extract the average values of every vegetation indices for each plot and then train the model.
Datasets
The dataset for this tutorial can be found in the raster4ml_data
google drive repository.
Download the chlorophyll.tar.gz
file and extract in the data directory.
1. Micasense Altum Image
The image provided was collected from a UAV-borne multispectral sensor called Micasense Altum. More information about Altum camera can be found here. It has blue, green, red, red-edge, and near infrared (NIR) bands. The channels in the attached image also follows the previously mentioned order of bands. The center wavelengths of the bandas can be found in this link.
2. Visualize
Try to visualize the image using the plotting
functionality of raster4ml
.
2. Calculate Vegetation Indices
Calculate the vegetation indices from the micasense-altum-5bands.tif
image. Please
remember to consider the threshold
parameter. Depending on the threshold
you will
get the desired amount of VIs. The image provided has a reflectance value ranging from 0
to 1, which is why there is no need to provide any bit_depth information.
# Define the VegetationIndices object
VI = VegetationIndices(`...`)
# Run the process while providing the output directory
VI.calculate(out_dir='...')
3. Extract Values based on plot shape
Locate the sample polygon shapefile in the extracted data folder. The name of the shapefile
is plot-shapefile.shp
. There are two columns in this shape, i.e., plotid
and
chl
, where the first one is the unique id and the later is the measured chlorophyll
value. You can use the batch_extract_by_polygons
from the extraction
module.
You can only extract the mean
as the statistics.
# Batch extract values by polygons
values = batch_extract_by_polygons(`...`)
4. Machine Learning Training
Now train at least 3 machine learning regression models of your choice. Remember to do feature scaling, feature selection, and hyperparameter optimization. Also, perform a 70/30 split of training and testing, where the models should be evaluated using the root mean squared error of the test set.
raster4ml package
Submodules
raster4ml.extraction module
- raster4ml.extraction.batch_extract_by_points(image_paths, shape_path, unique_id)[source]
Batch extract values from a set of raster data using point shapefile.
- Parameters
image_paths (list) – List of image paths.
shape_path (str) – Path of the shapefile.
unique_id (str) – A unique column in the shapefile which will be retained as the id.
- Returns
A pandas dataframe containing all the values per id.
- Return type
pandas dataframe
- raster4ml.extraction.batch_extract_by_polygons(image_paths, shape_path, unique_id, statistics='all')[source]
Batch extract value by a polygon shapefile from a given image paths. Similar to zonal statistics.
- Parameters
image_paths (list) – List of image paths.
shape_path (str) – Path of the shapefile.
unique_id (str) – A unique column in the shapefile which will be retained as the id.
statistics (str or list) – List of statistics to be calculated if shape is polygon. Accepted statsitcs are either ‘all’ or a list containing follwoing statistics: ‘mean’, ‘median’, ‘mode’, ‘sum’, ‘min’, ‘max’, ‘std’, ‘range’, ‘iqr’, ‘unique’. If only one statistic to be calculated, that should be inside a list. For example, if only ‘mean’ is to be calculated, it should be given as [‘mean’].
prefix (str, optional) – If predix is given, then the prefix will be used in front of the statistics name within the final dataframe column, by default None
- Returns
A pandas dataframe containing all the statistics values per id. Each column name will be made through automatically adding a prefix (which is the filename of each image) and the corresponding statistics.
- Return type
pandas dataframe
- raster4ml.extraction.clip_by_polygons(image_path, shape_path, unique_id, out_dir, out_type='numpy')[source]
Clip a raster image by a polygon shapefile.
Based on the geometry of each polygon, the function will clip the images and save it in a given directory with a unique name.
- Parameters
image_path (str) – Path of the image.
shape_path (str) – Path of the shapefile.
unique_id (str) – A unique column in the shapefile which will be retained as the id.
out_dir (str) – Path of the directory where the clipped images will be saved.
out_type (str, optional) – The type of output data. It can be either ‘numpy’ or ‘tif’, by default ‘numpy’
- Returns
Saves the clipped data.
- Return type
None
- Raises
ValueError – The shapefile must be either Polygon or MultiPolygon.
- raster4ml.extraction.extract_by_points(image_path, shape_path, unique_id)[source]
Extract value by a point shapefile.
The function will extract the pixel values underneath each point in a given point shapefile.
- Parameters
image_path (str) – Path of the image.
shape_path (str) – Path of the shapefile.
unique_id (str) – A unique column in the shapefile which will be retained as the id.
- Returns
A pandas dataframe containing all the values per id.
- Return type
pandas dataframe
- Raises
ValueError – The shapefile must be either Point or MultiPoint.
- raster4ml.extraction.extract_by_polygons(image_path, shape_path, unique_id, statistics='all', prefix=None)[source]
Extract value from a raster data using a polygon shapefile. Similar to Zonal Statistics.
- Parameters
image_path (str) – Path of the image.
shape_path (str) – Path of the shapefile.
unique_id (str) – A unique column in the shapefile which will be retained as the id.
statistics (str or list) – List of statistics to be calculated if shape is polygon. Accepted statsitcs are either ‘all’ or a list containing follwoing statistics: ‘mean’, ‘median’, ‘mode’, ‘sum’, ‘min’, ‘max’, ‘std’, ‘range’, ‘iqr’, ‘unique’. If only one statistic to be calculated, that should be inside a list. For example, if only ‘mean’ is to be calculated, it should be given as [‘mean’].
prefix (str, optional) – If predix is given, then the prefix will be used in front of the statistics name within the final dataframe column, by default None
- Returns
A pandas dataframe containing all the statistics values per id.
- Return type
pandas dataframe
- Raises
ValueError – The shapefile must be either Polygon or MultiPolygon.
raster4ml.features module
- class raster4ml.features.VegetationIndices(image_path, wavelengths, threshold=10, bit_depth=None)[source]
Bases:
object
Constructs all the necessary attributes for the VegetationIndices object.
- Parameters
image_path (str) – Path of the image.
wavelengths (list or list of lists) –
The wavelengths (in nanometer) of the bands in the stacked image. It can be either a list containing the center wavelengths of the bands, or it can be a list of lists where each element represents the initial and final wavelength.
Example: If list: [430, 450, 560] If list of lists: [[420, 440], [530, 560], [670, 690]]
threshold (int (optional)) – An integer value which defines the threshold of wavelength. For example, if a band’s wavelngth is 550 nm and threshold is 10, then the vegetation index calculation will consider 550 +/- 10 nm as the input. It is suggested to use smaller threshold value (or keep the default 10) while using hyperspectral images and larger values (may be 100) for multispectral images.
bit_depth (int (optional)) – Bit depth of the image. For example, Landsat 8 images are 14-bit. So if 14 is given as the bit_depth, then the image values will be divided by 2**14=16384.
- calculate(out_dir, featuers='all'):
Calculate all the vegetation indices possible. The index list is adapted from: https://www.indexdatabase.de/
- Raises
ValueError – If invalid image path is given.
- AFRI1600()[source]
Aerosol free vegetation index 1600
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- AFRI2100()[source]
Aerosol free vegetation index 2100
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ARI()[source]
Anthocyanin reflectance index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ARVI()[source]
Atmospherically Resistant Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ARVI2()[source]
Atmospherically Resistant Vegetation Index 2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ATSAVI()[source]
Adjusted transformed soil-adjusted VI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- AVI()[source]
Ashburn Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- BGI()[source]
Blue green pigment index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- BNDVI()[source]
Blue Normalized Difference Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- BRI()[source]
Blue red pigment index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- BWDRVI()[source]
Blue-wide dynamic range vegetation index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CARI()[source]
Chlorophyll Absorption Ratio Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CARI2()[source]
Chlorophyll Absorption Ratio Index 2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CASI_NDVI()[source]
CASI NDVI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CASI_TM4_3()[source]
CASI TM4/3
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CCCI()[source]
Canopy Chlorophyll Content Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CI()[source]
Curvative index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CIgreen()[source]
Chlorophyll Index Green
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CIrededge()[source]
Chlorophyll Index RedEdge 710
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CIrededge710()[source]
Chlorophyll Index RedEdge 710
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CTVI()[source]
Corrected Transformed Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- CVI()[source]
Chlorophyll vegetation index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- Chlgreen()[source]
Chlorophyll Green
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- Chlrededge()[source]
Chlorophyll RedEdge
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- D678_500()[source]
Difference 678 & 500
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- D800_550()[source]
Difference 800 & 550
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- D800_680()[source]
Difference 800 & 680
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- D833_658()[source]
Difference 833 & 658
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- DD()[source]
Double Difference Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- DDn()[source]
Double Difference Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- DPI()[source]
Double Peak Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- DSWI()[source]
Disease water stress index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- DSWI5()[source]
Disease water stress index 5
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- DVIMSS()[source]
Differenced Vegetation Index MSS
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- EVI()[source]
Enhanced Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- EVI2()[source]
Enhanced Vegetation Index 2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- EVI3()[source]
Enhanced Vegetation Index 3
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GARI()[source]
Green atmospherically resistant vegetation index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GBNDVI()[source]
Green-Blue NDVI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GDVI()[source]
Green Difference Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GEMI()[source]
Global Environment Monitoring Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GLI()[source]
Green leaf index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GNDVI()[source]
Blue Normalized Difference Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GNDVIhyper()[source]
Green NDVI hyper
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GNDVIhyper2()[source]
Green NDVI hyper 2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GOSAVI()[source]
Green Optimized Soil Adjusted Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GSAVI()[source]
Green Soil Adjusted Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- GVIMSS()[source]
Tasselled Cap - Green Vegetation Index MSS
- Returns
GVIMSS
- Return type
numpy 2d-array
- GVMI()[source]
Global Vegetation Moisture Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- Gitelson()[source]
Gitelson index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- IF()[source]
Shape Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- IPVI()[source]
Infrared percentage vegetation index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- IR550()[source]
Inverse reflectance 550
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- IR700()[source]
Inverse reflectance 700
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- LCI()[source]
Leaf Chlorophyll Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- LWCI()[source]
Leaf Water Content Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- LWVI1()[source]
Leaf water vegetation index 1
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- LWVI2()[source]
Leaf water vegetation index 1
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- LogR()[source]
Log ratio
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MCARI()[source]
Modified Chlorophyll Absorption in Reflectance Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MCARI1()[source]
Modified Chlorophyll Absorption in Reflectance Index 1
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MCARI1510()[source]
Modified Chlorophyll Absorption in Reflectance Index 1510
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MCARI2()[source]
Modified Chlorophyll Absorption in Reflectance Index 2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MCARI705()[source]
Modified Chlorophyll Absorption in Reflectance Index 705, 750
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MCARI710()[source]
Modified Chlorophyll Absorption in Reflectance Index 710, 750
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MGVI()[source]
Misra Green Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MND_734_747_715_720()[source]
Modified Normalized Difference 734/747/715/720
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MND_750_705()[source]
Modified Normalised Difference 750/705
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MND_850_1788_1928()[source]
Modified Normalized Difference 850/1788/1928
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MND_850_2218_1928()[source]
Modified Normalized Difference 850/2218/1928
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MNLI()[source]
Modified NLI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MNSI()[source]
Misra Non Such Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MRVI()[source]
Modified Normalized Difference Vegetation Index RVI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MSAVI()[source]
Modified Soil Adjusted Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MSAVIhyper()[source]
Modified Soil Adjusted Vegetation Index hyper
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MSBI()[source]
Misra Soil Brightness Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MSR670()[source]
Modified Simple Ratio 670, 800
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MSR705()[source]
Modified Simple Ratio 705, 750
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MSR_705_445()[source]
Modified Simple Ratio 705, 445
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MSR_NIR_Red()[source]
Modified Simple Ratio NIR Red
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MTCI()[source]
MERIS Terrestrial chlorophyll index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MTVI1()[source]
Modified Triangular Vegetation Index 1
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MTVI2()[source]
Modified Triangular Vegetation Index 2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MVI()[source]
Mid-infrared vegetation index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- MYVI()[source]
Misra Yellow Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NBR()[source]
Normalized Burn Ratio
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDBleaf()[source]
Normalized Difference leaf canopy biomass
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDLI()[source]
Normalized Difference Lignin Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDMI()[source]
Normalized Difference Moisture Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDNI()[source]
Normalized Difference Nitrogen Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDRE()[source]
Normalized Difference Rededge Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDSI()[source]
Normalized Difference Salinity Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDVI()[source]
Normalized Difference Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDVI_700()[source]
NDVI 700
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDVI_705()[source]
Chl NDVI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDVI_rededge()[source]
Normalized Difference Rededge/Red
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDVIg()[source]
Green NDVI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDWI_Hyp()[source]
Normalized difference water index hyperion
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1080_1180()[source]
Normalized difference 1080 1180
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1080_1260()[source]
Normalized difference 1080 1260
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1080_1450()[source]
Normalized difference 1080 1450
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1080_1675()[source]
Normalized difference 1080 1675
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1080_2170()[source]
Normalized difference 1080 2170
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1180_1450()[source]
Normalized difference 1180 1450
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1180_1675()[source]
Normalized difference 1180 1675
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1180_2170()[source]
Normalized difference 1180 2170
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1260_1450()[source]
Normalized difference 1260 1450
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1260_1675()[source]
Normalized difference 1260 1675
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1260_2170()[source]
Normalized difference 1260 2170
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_1510_660()[source]
Normalized difference 1260 660
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_682_553()[source]
Normalized difference 682 553
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_750_650()[source]
Normalized difference 750 650
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_750_660()[source]
Normalized difference 750 660
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_750_680()[source]
Normalized difference 750 680
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_774_677()[source]
Normalized difference 774 677
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_782_666()[source]
Normalized difference 782 666
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_790_670()[source]
Normalized difference 790 670
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_800_1180()[source]
Normalized difference 800 1180
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_800_1260()[source]
Normalized difference 800 1260
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_800_1450()[source]
Normalized difference 800 1450
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_800_1675()[source]
Normalized difference 800 1675
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_800_2170()[source]
Normalized difference 800 2170
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_800_680()[source]
Normalized difference 800 680
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_819_1600()[source]
Normalized difference 819 1600
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_819_1649()[source]
Normalized difference 819 1649
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_827_668()[source]
Normalized difference 827 668
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_833_1649()[source]
Normalized difference 833 1649
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_833_658()[source]
Normalized difference 833 658
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_850_1650()[source]
Normalized difference 850 1650
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_857_1241()[source]
Normalized difference 857 1241
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_860_1240()[source]
Normalized difference 860 1240
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_895_675()[source]
Normalized difference 895 675
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_900_680()[source]
Normalized difference 900 680
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_960_1180()[source]
Normalized difference 960 1180
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_960_1260()[source]
Normalized difference 960 1260
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_960_1450()[source]
Normalized difference 960 1450
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_960_1675()[source]
Normalized difference 960 1675
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- ND_960_2170()[source]
Normalized difference 960 2170
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDchl()[source]
Normalized Difference Chlorophyll
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NDlma()[source]
Normalized Difference leaf mass per area
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NGRDI()[source]
Normalized Green Red Difference Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NLI()[source]
Nonlinear vegetation index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NPCI()[source]
Normalized Pigment Chlorophyll Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NPQI()[source]
Normalized Phaeophytinization Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NormG()[source]
Normalized Green
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NormNIR()[source]
Normalized NIR
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- NormR()[source]
Normalized Red
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- OSAVI()[source]
Optimized Soil Adjusted Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- OSAVI2()[source]
Optimized Soil Adjusted Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- OSAVI_1510()[source]
Optimized Soil Adjusted Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PNDVI()[source]
Pan NDVI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PPR()[source]
Plant pigment ratio
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PRI_528_587()[source]
Photochemical Reflectance Index 528/587
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PRI_531_570()[source]
Photochemical Reflectance Index 531/570
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PRI_550_530()[source]
Photochemical Reflectance Index 550/530
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PRI_570_531()[source]
Photochemical Reflectance Index 570/531
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PRI_570_539()[source]
Photochemical Reflectance Index 570/539
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PSNDa1()[source]
Pigment specific normalised difference A1
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PSNDb1()[source]
Pigment specific normalised difference B1
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PSNDb2()[source]
Pigment specific normalised difference B2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PSNDc1()[source]
Pigment specific normalised difference C1
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PSNDc2()[source]
Pigment specific normalised difference C2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PSRI()[source]
Plant Senescence Reflectance Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PVIhyp()[source]
Hyperspectral perpendicular VI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- PVR()[source]
Photosynthetic vigour ratio
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- R(wavelength)[source]
Find the nearest band of the image from given wavelength.
- Parameters
wavelength (float) – The wavelength in nm.
- Returns
The image numpy nd-array with selected bands matching the wavelength.
- Return type
numpy nd-array
- RARS()[source]
Ratio Analysis of Reflectance Spectra, Simple Ratio of 760 500
- Returns
RARS
- Return type
numpy 2d-array
- RBNDVI()[source]
Red-Blue NDVI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- RDVI()[source]
Renormalized Difference Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- REIP1()[source]
Red-Edge Inflection Point 1
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- REIP2()[source]
Red-Edge Inflection Point 2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- REIP3()[source]
Red-Edge Inflection Point 3
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- RENDVI()[source]
Red edge NDVI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- REP()[source]
Red-Edge Position Linear Interpolation
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- RI()[source]
Normalized Burn Ratio
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- RRE()[source]
Reflectance at the inflexion point
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- RVSI()[source]
Red-Edge Stress Vegetation Index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- R_675_700_650()[source]
Ratio 675 700 650
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- R_WI_ND750()[source]
Ratio 675 700 650
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- Rededge2()[source]
Rededge1
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SARVI2()[source]
Soil and Atmospherically Resistant Vegetation Index 2
- Returns
SR_355_365_gk
- Return type
numpy 2d-array
- SBIMSS()[source]
Tasselled Cap - Soil Brightness Index MSS
- Returns
NSIMSS
- Return type
numpy 2d-array
- SR_1058_1148()[source]
Simple Ratio of 1058 1148
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1080_1180()[source]
Simple Ratio of 1080 1180
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1080_1260()[source]
Simple Ratio of 1080 1260
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1080_1450()[source]
Simple Ratio of 1080 1450
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1080_1675()[source]
Simple Ratio of 1080 1675
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1080_2170()[source]
Simple Ratio of 1080 2170
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1180_1080()[source]
Simple Ratio of 1180 1080
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1180_1450()[source]
Simple Ratio of 1180 1450
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1180_1675()[source]
Simple Ratio of 1180 1675
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1180_2170()[source]
Simple Ratio of 1180 2170
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1193_1126()[source]
Simple Ratio of 1193 1126
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1250_1050()[source]
Simple Ratio of 1250 1050
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1260_1080()[source]
Simple Ratio of 1260 1080
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1260_1450()[source]
Simple Ratio of 1260 1450
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1260_1675()[source]
Simple Ratio of 1260 1675
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1260_2170()[source]
Simple Ratio of 1260 2170
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1450_1080()[source]
Simple Ratio of 1450 1080
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1450_1180()[source]
Simple Ratio of 1450 1180
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1450_1260()[source]
Simple Ratio of 1450 1260
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1450_960()[source]
Simple Ratio of 1450 960
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1600_820()[source]
Simple Ratio of 1600 820
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1650_2218()[source]
Simple Ratio of 1650 2218
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1660_550()[source]
Simple Ratio of 1660 550
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1660_680()[source]
Simple Ratio of 1660 680
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1675_1080()[source]
Simple Ratio of 1675 1080
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1675_1180()[source]
Simple Ratio of 1675 1180
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1675_1260()[source]
Simple Ratio of 1675 1260
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_1675_960()[source]
Simple Ratio of 1675 960
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_2170_1080()[source]
Simple Ratio of 2170 1080
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_2170_1180()[source]
Simple Ratio of 2170 1180
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_2170_1260()[source]
Simple Ratio of 2170 1260
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_2170_960()[source]
Simple Ratio of 2170 960
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_355_365_gk()[source]
Simple Ratio of SR_355_365_gk
- Returns
SR_355_365_gk
- Return type
numpy 2d-array
- SR_430_680()[source]
Simple Ratio of 430 680
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_440_690()[source]
Simple Ratio of 440 690
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_440_740()[source]
Simple Ratio of 440 740
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_520_420()[source]
Simple Ratio of 520 420
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_520_670()[source]
Simple Ratio of 520 670
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_520_760()[source]
Simple Ratio of 520 760
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_542_750()[source]
Simple Ratio of 542 750
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_550_420()[source]
Simple Ratio of 550 420
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_550_670()[source]
Simple Ratio of 550 670
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_550_680()[source]
Simple Ratio of 550 680
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_550_760()[source]
Simple Ratio of 550 760
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_550_800()[source]
Simple Ratio of 550 800
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_554_677()[source]
Simple Ratio of 554 677
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_556_750()[source]
Simple Ratio of 556 750
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_560_658()[source]
Simple Ratio of 560 658
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_605_420()[source]
Simple Ratio of 605 420
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_605_670()[source]
Simple Ratio of 605 670
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_605_760()[source]
Simple Ratio of 605 760
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_672_550()[source]
Simple Ratio of 672 550
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- SR_672_708()[source]
Simple Ratio of 672 708
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- TCARI1510()[source]
Transformed Chlorophyll Absorbtion Ratio 1510
- Returns
NSIMSS
- Return type
numpy 2d-array
- TCARI2()[source]
Transformed Chlorophyll Absorbtion Ratio 2
- Returns
NSIMSS
- Return type
numpy 2d-array
- TSAVI()[source]
Transformed Soil Adjusted Vegetation Index
- Returns
NSIMSS
- Return type
numpy 2d-array
- VARI700()[source]
Visible Atmospherically Resistant Index 700
- Returns
NSIMSS
- Return type
numpy 2d-array
- VARIgreen()[source]
Visible Atmospherically Resistant Index Green
- Returns
NSIMSS
- Return type
numpy 2d-array
- VARIrededge()[source]
Visible Atmospherically Resistant Index RedEdge
- Returns
NSIMSS
- Return type
numpy 2d-array
- Vog2()[source]
Modified Normalised Difference 734/747/715/726 Vogelmann indices 2
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- YVIMSS()[source]
Tasselled Cap - Yellow Vegetation Index MSS
- Returns
NSIMSS
- Return type
numpy 2d-array
- calculate(out_dir, features='all')[source]
_summary_
- Parameters
out_dir (str) – Path of the directory where indice(s) will be saved.
features (str or list (optional)) – If ‘all’ then all the vegetation indices available in the package will be calculated. Or the user can put the names of the indices to calculate in a list. Allowable indices are:
- Returns
Saves the output indices.
- Return type
None
- Raises
ValueError – _description_
- mARI()[source]
Modified anthocyanin reflectance index
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
- mNDVI()[source]
Modified NDVI
- Returns
A 2D numpy array of calcualted feature.
- Return type
numpy 2d-array
raster4ml.plotting module
raster4ml.preprocessing module
- raster4ml.preprocessing.reproject_raster(src_image_path, dst_image_path, band=None, dst_crs='EPSG:4326')[source]
Reproject the raster into a different CRS.
- Parameters
src_image_path (str) – Path of the image to be reprojected.
dst_image_path (src) – Path of the destination image as reprojected.
band (int, (Optional)) – Specify the band to reproject.
dst_crs (str) – The destination CRS in EPSG code. For example, ‘EPSG:4326’, Default to ‘EPSG:4326’
- Returns
Nothing returns, the image is saved.
- Return type
None
- raster4ml.preprocessing.stack_bands(image_paths, out_file)[source]
Stack the images together as bands.
- Parameters
image_paths (list) – List of images that needs to be stacked
out_file (src) – Output path fot the stacked image. Supports .tif.
- Returns
Nothing returns, the image is saved.
- Return type
None
- Raises
ValueError – If invalid image path is given.
raster4ml.utils module
- raster4ml.utils.check_projection(src, shape)[source]
Check if the raster and shapefile has same projection or not. If not, it reprojects the shapefile.
- Parameters
src (rasterio object) – An image opened by rasterio.
shape (geopandas object) – A shapfile opened using geopandas.
- Returns
The same given shapefile but reprojected to raster data’s projection.
- Return type
geopandas object
- raster4ml.utils.get_vegetation_indices_names()[source]
Returns all supported vegetation index names to calcualte.
- Returns
List of vegetation indices.
- Return type
list
- raster4ml.utils.save_raster(src, array, out_path, **kwargs)[source]
Saves a numpy image into a geospatial tif image.
- Parameters
src (rasterio object) – An image object opened using rasterio.
array (numpy nd-array) – A numpy nd-array which needs to be saved.
out_path (str) – Output path where the tif file will be saved.
- Returns
Saves the image.
- Return type
None