This service allows you to save geometries like polygons or points in our database. Each AOI can be uniquely identified by an ID and allows to filter other data in our system or to configure monitoring tasks for long term analysis.

ENDPOINTS


POST /aois
GET /aois
GET /aois/:id
DELETE /aois/:id

Create AOI

Retrieve a list of burned areas. The burned areas are returned in sorted order, with the most recent appearing first.

Create an AOI by sending us your geometry.

The geometry can be sent in two different formats:

  1. Array of JSON Objects [{"lat":39.6848587990413,"lng":-3.6344947175489},...]
  2. Geojson Feature

Returns

Returns the id of your AOI in json.

POST /aois

curl (example array of objects)

curl <https://api.riscognition.io/aois> \\
-H "Authorization: Bearer YOUR-API-KEY" \\
-H "Content-Type: application/json" \\
-X POST \\
-d '[{"lat":39.6848587990413,"lng":-3.6344947175489},...]'

python (example geojson feature)

aoi = {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              8.563156127929688,
              46.120131387408954
            ],
            [
              ...
            ]
          ]
        ]
      }
    }

headers = {'Authorization': 'Bearer YOUR-API-KEY'}
response = requests.post("<https://api.riscognition.io/aois>", json = aoi, headers = headers)

List AOIs

Retrieve a list of all your AOIs stored in our database.

Returns

Returns a GeoJson FeatureCollection of your AOIs.

GET /aois

curl

curl <https://api.riscognition.io/aois> \\
-H "Authorization: Bearer YOUR-API-KEY"

python

headers = {'Authorization': 'Bearer YOUR-API-KEY'}
response = requests.get("<https://api.riscognition.io/aois>", headers = headers)

Retrieve a single AOI

Retrieve a single AOI by it’s ID.

| --- | --- | --- |

Returns

Returns a the AOI in geojson.

GET /aois/:id

curl

curl "<https://api.riscognition.io/aois/014215fc-448a-4178-906b-9054ac5262da>" \\
-H "Authorization: Bearer YOUR-API-KEY"

python

headers = {'Authorization': 'Bearer YOUR-API-KEY'}
response = requests.get("<https://api.riscognition.io/aois/014215fc-448a-4178-906b-9054ac5262da>", headers = headers)


Delete an AOI

Delete one of your AOIs from our database. Deleting an AOI is an irreversible action.

| --- | --- | --- |

Returns

Returns “OK” on success.

DELETE /aois/:id

curl

curl <https://api.riscognition.io/aois/562dsa25> \\
-H "Authorization: Bearer YOUR-API-KEY" \\
-X DELETE

python

headers = {'Authorization': 'Bearer YOUR-API-KEY'}
response = requests.delete("<https://api.riscognition.io/aois/YOUR-AOI-ID>", headers = headers)