πΊοΈExternal integrations and maps
Last updated
Last updated
TimberID pulls data from external data sources to enhance the sample report for uncertain/untrusted samples. These are:
MapBiomas (https://plataforma.brasil.mapbiomas.org/)
Land use map
Land use statistics
Water (rivers, lakes, etc)
Primary vegetation (Forest)
Secondary vegetation and regrowth (e.g. pastures)
Anthropic use (e.g. agriculture, urban areas)
MapBiomas Alerta (https://plataforma.alerta.mapbiomas.org/)
Deforestation alerts
The MapBiomas project provides Google Earth Engine (GEE) images of land use data in Brazil.
To access this data from the Earth Engine code editor (https://code.earthengine.google.com) you can use this link to add the MapBiomas user toolkit to your scripts folder. You can also find the MapBiomas user toolkit on Github. You can also find the MapBiomas entry in the GEE Community Catalog for more info.
Once you add the user toolkit, you can access the deforestation images like so:
MapBiomas releases their updated data in regular "collections". You can find the GEE Image url to the images in the source code.
This is an example of how this image is displayed in TimberID, in the sample details page.This is only displayed for uncertain/untrusted samples, not for reference/trusted samples.
The MapBiomas map is centered on the [latitude, longitude]
of the sample, showing a 1 km buffer zone (in white) and a 10km buffer zone (in black). Below the map, the UI displays what current percentage of land is water in both 1km and 10km radii, and below the map are details of each land use category for the last 10 years of MapBiomas data (2011 - 2021).
The map is created using the Earth Engine Python API, using the geemap
module.
Geemap allows students and researchers to use the Python ecosystem of diverse libraries and tools to explore Google Earth Engine. In particular, it's designed for existing GEE users who would like to transition from the GEE JavaScript API to Python API, so the library will be familiar for uses of the former.
The creation of map is mediated by Cloud Functions, specifically the fraud-detection-generate-maps function (see more details on Cloud Functions here). You can see a diagram of how that works below:
The blue flow happens once a day at 9am, the orange flow is triggered every time a sample is created or modified.
Maps for every sample are regenerated every day by the flow displayed in blue. This is because the geemap
assets in the generated HTML expire after 48 hours.
You can find links each of the components below:
Cloud Scheduler:
Pub / Sub:
Cloud Functions:
Cloud Storage Bucket:
Dev: timberid-public-to-internet - Prod: timberid-public-to-internet
Component containing map's iframe on frontend:
Land Use Data is calculated in the fraud-detection-update-sample function, specifically in the section fraud_detection_fetch_land_use_data.py. This uses the Earth Engine Python API.
This is an example of how deforestation alerts data is displayed in TimberID, in the sample details page. This is only displayed for uncertain/untrusted samples, not for reference/trusted samples.
The corresponding page to each alert is linked on the details column under "More info". You can see an example alert here.
This data comes from MapBiomas Alerta's GraphQL API. Deforestation alerts data is fetched and stored in the fraud-detection-update-sample function, specifically in the section fraud_detection_fetch_mapbiomas_alerts.py.
This API is generally available and doesn't require authentication. You can find more details about the API in this link: https://plataforma.alerta.mapbiomas.org/api (viewing this page requires login, create a new account to access the content). This link also includes a Sandbox to test this GraphQL api, too.