📘

Quick Start

Here is a recipe to get NDVI for a polygon.

Polygons

There are two types of polygon queries:

  • Single polygon
  • Multiple polygons

All points that define polygons must use the WGS84 (EPSG:4326) coordinate reference system (CRS).

Aggregation

By default, the Streambatch outputs the median NDVI for a polygon. Set the aggregation to one of mean, median, min,max, or sum to set the aggregation method explicitly:

ndvi_request = {
   ...
    'aggregation': 'mean' # specify aggregation method
}

Single Polygon

To get NDVI for a single polygon, set the space parameter to a list containing a single GeoJSON polygon:

polygon = [{'type':'Polygon', 'coordinates':[[(-44.149163, -20.789250), (-44.162389, -20.793057), (-44.157394, -20.802396), (-44.144168, -20.798589)]]}]

'space': polygon

Multiple Polygons

To get NDVI for multiple polygons, set the space parameter to a list of GeoJSON polygons:

polygons = [{'type':'Polygon', 'coordinates':[[(-44.149163, -20.789250), (-44.162389, -20.793057), (-44.157394, -20.802396), (-44.144168, -20.798589)]]},
            {'type':'Polygon', 'coordinates':[[(-45.149163, -21.789250), (-45.162389, -21.793057), (-45.157394, -21.802396), (-45.144168, -21.798589)]]]

'space': polygons

🚧

Note

The space parameter cannot be a MultiPolygon GeoJSON object.