Download Indices

Download a spectral index for a scene cropped by a bounding box or an area of interest (AOI). Result is saved on AWS S3 bucket, the URL is returned.

Result image info:

  • file name: <scene>_<combination>.TIF, where scene - lv_id or scene_id; combination - name_alias else bm_type
  • number of bands equals the length of expressions list in bm_type, each band represents bandmath provided by its expression
  • file format: GTiff
  • depth: Float32
  • tiled: yes, block=512x512
  • pixel size and resolution: resample to the lowest resolution among bands in ‘args’.
  • no data value == -9999
POST /api?api_key=<API_KEY>
JSON Parameters:
 
  • type – (required) Operation name. Value is ‘bandmath’.
  • params – (required) Request parameters.
  • params.view_id – (required) View id of the scene returned by the Search API, see Search API. Example values: “L8/LC80110312016028LGN00”, “S2/19/T/CG/2017/7/9/0”, “MODIS/12/04/2017204/2017213034223” etc
  • params.bbox – (required to crop by AOI: either bbox, geometry or cropper_ref must be set) Bounding box in EPSG:4326; order: westing, southing, easting, northing (i.e. minx, miny, maxx, maxy). If null process full scene.
  • params.geometry – (required to crop by AOI: either bbox, geometry or cropper_ref must be set) A GeoJSON representation of a geometry describing the AOI. Supported geometry types: “Polygon”, “MultiPolygon”. If neither geometry nor bbox were provided, then process a full scene
  • params.cropper_ref – (required to crop by AOI: either bbox, geometry or cropper_ref must be set) A resourse id of a GeoJSON representation of a geometry saved into data base using Cropper API
  • params.bm_type – (required) Band combination to calculate. Example: “(B5-B4)/(B5+B4),(B3-B5)/(B3+B5),(B3-B6)/(B3+B6)”, “B5-1” etc. For available band combinations please refer to Name Aliases and Supported Datasets
  • params.name_alias – (optional) User name of bandmath to be used in output file name.
  • params.reference – (required) Unique id to assign to the request
Query Parameters:
 
  • api_key – (required) user’s API key

Examples

Index

Evaluate one expression.

Example NDVI for Landsat 8 by bbox

http

POST /api?api_key=XXX HTTP/1.1
Host: gdw.eos.com
Content-Type: application/json

{
    "type": "bandmath",
    "params": {
            "bm_type": "(B5-B4)/(B5+B4)",
            "view_id": "L8/LC08_L1TP_025039_20180628_20180704_01_T1",
            "bbox": [-94.72171783447267, 29.921613319695577, -94.54284667968751, 30.16917237969733],
        "name_alias": "NDVI",
        "reference": "ref_1543315137"
    }
}

curl

curl -i -X POST 'https://gdw.eos.com/api?api_key=XXX' -H 'Content-Type: application/json' --data-raw '{"params": {"bbox": [-94.72171783447267, 29.921613319695577, -94.54284667968751, 30.16917237969733], "bm_type": "(B5-B4)/(B5+B4)", "name_alias": "NDVI", "reference": "ref_1543315137", "view_id": "L8/LC08_L1TP_025039_20180628_20180704_01_T1"}, "type": "bandmath"}'

Output file name shall be: L8-LC08_L1TP_025039_20180628_20180704_01_T1_NDVI.TIF

Example RECI for Landsat 8. Crop by geometry

http

POST /api?api_key=XXX HTTP/1.1
Host: gdw.eos.com
Content-Type: application/json

{
   "type":"bandmath",
   "params":{
       "view_id":"L8/LC08_L1TP_029033_20170317_20170328_01_T1",
       "bm_type":"(B5/B3)-1",
       "geometry": {"type":"Polygon","coordinates":[[[-98.402481,38.284008],[-98.326778,38.33075],[-98.285065,38.291823],[-98.373127,38.245191],[-98.331413,38.29344],[-98.402481,38.284008]]]},
       "name_alias": "Green Chlorophyll Index",
       "reference": "ref_1543315137"
   }
}

curl

curl -i -X POST 'https://gdw.eos.com/api?api_key=XXX' -H 'Content-Type: application/json' --data-raw '{"params": {"bm_type": "(B5/B3)-1", "geometry": {"coordinates": [[[-98.402481, 38.284008], [-98.326778, 38.33075], [-98.285065, 38.291823], [-98.373127, 38.245191], [-98.331413, 38.29344], [-98.402481, 38.284008]]], "type": "Polygon"}, "name_alias": "Green Chlorophyll Index", "reference": "ref_1543315137", "view_id": "L8/LC08_L1TP_029033_20170317_20170328_01_T1"}, "type": "bandmath"}'

Output file name shall be: L8-LC08_L1TP_029033_20170317_20170328_01_T1_Green_Chlorophyll_Index.TIF

Index Stack

Evaluate several expressions. Stack result into a multiband image.

Example Index Stack for Landsat 8

http

POST /api?api_key=XXX HTTP/1.1
Host: gdw.eos.com
Content-Type: application/json

{
    "type": "bandmath",
    "params": {
            "bm_type": "(B5-B4)/(B5+B4),(B3-B5)/(B3+B5),(B3-B6)/(B3+B6)",
            "view_id": "L8/LC08_L1TP_025039_20180628_20180704_01_T1",
            "bbox": [-94.72171783447267, 29.921613319695577, -94.54284667968751, 30.16917237969733],
        "name_alias": "istack",
        "reference": "ref_1543315137"
    }
}

curl

curl -i -X POST 'https://gdw.eos.com/api?api_key=XXX' -H 'Content-Type: application/json' --data-raw '{"params": {"bbox": [-94.72171783447267, 29.921613319695577, -94.54284667968751, 30.16917237969733], "bm_type": "(B5-B4)/(B5+B4),(B3-B5)/(B3+B5),(B3-B6)/(B3+B6)", "name_alias": "istack", "reference": "ref_1543315137", "view_id": "L8/LC08_L1TP_025039_20180628_20180704_01_T1"}, "type": "bandmath"}'

Output file name shall be: L8-LC08_L1TP_025039_20180628_20180704_01_T1_istack.TIF

Example Sentinel-2. Crop by saved geometry

  1. Save the geometry using Cropper API.

http

POST /api/render/cropper/?api_key=XXX HTTP/1.1
Host: gate.eos.com
Content-Type: application/json

{
    "type": "Feature",
    "properties": {},
    "geometry": {
            "type": "Polygon",
            "coordinates": [
                    [
                            [-101.949692, 39.422403],
                            [-102.036896, 39.351821],
                            [-101.978531, 39.260436],
                            [-101.848068, 39.247676],
                            [-101.770477, 39.310394],
                            [-101.757431, 39.388979],
                            [-101.852188, 39.434602],
                            [-101.949692, 39.422403]
                    ]
            ]
    }
}

curl

curl -i -X POST 'https://gate.eos.com/api/render/cropper/?api_key=XXX' -H 'Content-Type: application/json' --data-raw '{"geometry": {"coordinates": [[[-101.949692, 39.422403], [-102.036896, 39.351821], [-101.978531, 39.260436], [-101.848068, 39.247676], [-101.770477, 39.310394], [-101.757431, 39.388979], [-101.852188, 39.434602], [-101.949692, 39.422403]]], "type": "Polygon"}, "properties": {}, "type": "Feature"}'

If a resource has been created successfully, the server responds with 200 OK:

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=UTF-8

{"cropper_ref": "c230d39994ab5f7a664c52d28eff1130"}
  1. Request download setting the AOI with a cropper_ref:

http

POST /api?api_key=XXX HTTP/1.1
Host: gdw.eos.com
Content-Type: application/json

{
   "type":"bandmath",
   "params":{
       "view_id":"S2/14/S/KJ/2018/11/22/0",
       "cropper_ref": "c230d39994ab5f7a664c52d28eff1130",
       "bm_type":"(B8A-B04)/(B8A+B04)",
       "name_alias": "ndvi",
       "reference": "ref_1543315137"
   }
}

curl

curl -i -X POST 'https://gdw.eos.com/api?api_key=XXX' -H 'Content-Type: application/json' --data-raw '{"params": {"bm_type": "(B8A-B04)/(B8A+B04)", "cropper_ref": "c230d39994ab5f7a664c52d28eff1130", "name_alias": "ndvi", "reference": "ref_1543315137", "view_id": "S2/14/S/KJ/2018/11/22/0"}, "type": "bandmath"}'