This chapter presents the main guidelines for efficient code writing, organizing and naming folders and files of all the initiatives.
This section provides important tips on efficient code writing.
When writing a code, observe the following guidelines:
Use .map() to apply a function over a feature or image collection;
Use .smilerandonforest() for classification (when using Random Forest);
Use forEach() to create a reducer by combining a copy of the given reducer for each output name in the given list or for each band of a given image;
Do not use .getinfo() because it breaks the processes while bring info from server to client.;
Use .print() and Map.addLayer() to debug the script.
This section describes folders structure and nomenclature, and cloud assets usage.
A structure of folders and collections will be created in the cloud asset for each country/region. Folders must always be named using capital letters only and collections should be named using lowercase letters, avoiding the use of special characters. Countries must use the following structure and terminology to organize their national assets:
mapbiomas-country
LULC
COLLECTION-1
GENERAL
SAMPLES
STABLE
classification
classification-ft
(for each cross-cutting theme, URBAN, AGRICULTURE, MANGROVE…)
SAMPLES
STABLE
classification
classification-ft
INTEGRATION
country-integration
COLLECTION-2
(...)
COLLECTION-3
(...)
FIRE / WATER
COLLECTION-1
SAMPLES
AUXILIARY-DATA
RASTER
VECTOR
PROCESSING
POST-PROCESSING
classification-1
INTEGRATION
COLLECTION-2
(...)
AUXILIARY-DATA
RASTER
VECTOR
The asset organization for each country will be revised by the secretariat frequently to guarantee that all the information is correctly organized.
“mapbiomas-public” stores public data from all countries and regions, initiatives and products.
“mapbiomas-territories” is used by the Mapbiomas Workspace Collections (WSC) platform to manage the territory vectors used to calculate statistics for all countries and regions, initiatives and products.
“mapbiomas-mosaics” is used to store Landsat and Sentinel mosaics of all countries and regions, initiatives and products. This space must always be optimized to avoid duplicates, obsolete versions and test data, avoiding thus annually requesting additional space for the Google Earth Engine team.
“mapbiomas-global” is used to store regional integrations.
This section describes accepted raster formats, guidelines on raster creation, nomenclature, and metadata.
The data formats that are accepted for storage are described below.
Classification image with multiple bands
Collection of classification images with multiple bands
Collection of classification images with a single band
Image of transitions with multiple bands
Collection of images of transitions with multiple bands
Collection of images of transitions with a single band
Mosaic
Collection of mosaics
Biomes or regions (e.g. vegetation, grasslands, savanas)
Standard: REGION-YEAR-VERSION or REGION-VERSION. For example: MATAATLANTICA-2010-1 or MATAATLANTICA-1. The format to be chosen depends on the type of asset selected by the team (see the Table in the 3.1 topic).
Use dash (-) to separate sections of the image name. Do not use underline (_).
All letters must be in uppercase.
The version should be informed with numeric characters only, and at the end of the image name. Do not use v1, v2, v3 or 01, 02, 03.
Cross-cutting themes
Standard: YEAR-VERSION (It is not necessary to inform the theme in the asset name, as the collection already defines the theme). Example: 2010-1
Use dash (-) to separate sections of the image name. Do not use underline (_).
All letters must be in uppercase.
The version should be informed with numeric characters only, and at the end of the image name. Do not use v1, v2, v3 or 01, 02, 03.
Metadata is very important for data management and the proper functioning of the WSC. A set of essential attributes and their types were defined (Table 1). These attributes must be added to the metadata of images exported to the GEE assets structure. Other attributes can be additionally entered if necessary.
Table 1: Attributes of the raster metadata.
Set the pixel values following the numeric IDs of the corresponding classes from your country or region's collection legend (see Legend chapter).
Images should be exported to the assets structure using the byte data format whenever possible.
It is essential that the classification is carried out with a buffer of 100 m to 2 km or overlapping area with neighboring regions, border strips and coastal areas so that there is no lack of information when using sections with different scales;
Use the "mode" method to generate the asset pyramid. This prevents the data from having rendering problems in GEE.
To avoid data versioning problems, it is advisable to always create a complete version containing the entire territory of the country/region and all mapped years. Avoid making corrections and adjustments to an already finished version. If you need to fix or adjust problems, create a new version.
If it is necessary to reclassify your data using a region of interest (protected areas, basin, municipality, etc.), make this adjustment within your classification process or while exporting the final data.
Document your version history. After each collection launch, asset maintenance will be carried out to delete obsolete and temporary data.
A template script is available to help you follow all of these instructions. The script is a generic version for customization:
https://code.earthengine.google.com/9ad85df6417a79d4d5730192b17699b5?noload=true .
This section provides guidelines on how to prepare territory shapefiles
category table
projection: WGS84
attribute table
Table 1: Attributes of the shapefiles.
Except for the ‘SOURCE’ and ‘VERSION’ fields, shapefiles attributes must not have empty data.
Verify if any topology issues are present and correct them before the upload. Check for map gaps, overlaying, duplicated data or invalid geometry, for example.
It is necessary to note whether the file is for public use or not.