3 LULC Classification Scheme
Module Overview
This module prompt the user to define the list of land cover or land use class which they’re going to classified using the Luma platform. Luma supports user-defined classification schemes and default classification or templates for commonly used classification schemes.
Input
| Name of input | Input Type | Details |
|---|---|---|
| User’s LULC list of classes | User’s input | Entered with .csv file or manually defined on the UI |
| Other existing LULC list of classes | System’s input | RESTORE+ LULC class |
Output
- LULC list of classes to be applied in the final classification result
Process
This module cannot be accessed if the system does not detect any saved satellite imagery from Module 1.
3.1 Selection of Classification Scheme
Luma User Journey
This is a part of User Journey 2.1: Choosing a classification scheme
- The user is given the options of creating the classification scheme:
- Upload the classification scheme
- Manually define the scheme on the UI
- Use an existing classification scheme
Luma Geospatial Engine
This sub-step does not involve any operations within the Luma Geospatial Engine.
- If the user chooses to upload their own schema, the system proceeds to Section 3.1.1
- If the user chooses to define the classification manually on the UI, the system proceeds to Section 3.1.2
- If the user chooses a default classification scheme, the system proceeds to Section 3.1.3
3.1.1 User Uploading Their Own Classification Scheme
Luma User Journey
The user is prompted to upload the
.csvfile containing the classification scheme information.The system displays a guidance notification indicating that the uploaded
.csvfile must contain at least three columns: a class ID (numeric identifier), a class name, and an optional hex color code specifying the display color for each class.The system automatically detects column headers based on common naming conventions. If the expected headers are not found, the user must manually assign the correct column names.
The user is prompted to finalize the scheme by clicking a button.
NoteSuccess NotificationThe system shows a confirmation if the classification table is successfully saved to the system.
ImportantError Handling NotificationThe system shows an error message if:
- The class ID is not a valid number
- There is a duplicate class ID
Luma Geospatial Engine
This is a part of System Response 2.1.a: Uploading classification scheme
The system automatically detects column headers based on common naming conventions for ID, class name, and color code. If the expected headers are not found, the user must manually assign the correct column names.
TipRelated Functionsclassification_scheme.LULC_scheme_Manager.auto_detect_csv_columns(): this function automatically detects the column headers. The set for the common naming conventions are currently hardcoded as the following:- For ID: “id”, “classid”, “kode”, “code”
- For class name: “classname”, “class”, “kelas”, “name”, “nama”
- For color code: “color”, “colorcode”, “warna”, “colour”, “hex”, “palette”
The system validates the uploaded
.csvto ensure IDs are numeric and unique, applies a set of distinct colors if no color code was provided by the user. The user can change the color code manually.TipRelated Functionsclassification_scheme.LULC_scheme_Manager.process_csv_upload(): to validate class data by checking ID integrity, assigning colors (_generate_distinct_colors), and returning a success status with a summary message.classification_scheme.LULC_scheme_Manager._generate_distinct_colors(): to generate a predefined set of distinct colors for LULC classes (up to 20). If the number of classes exceeds this limit, the method falls back to generating random colors via_generate_random_colors().classification_scheme.LULC_scheme_Manager._generate_random_colors(): to generate random hex color code.classification_scheme.LULC_scheme_Manager.finalize_csv_upload(): to finalize the CSV file by applying any user-assigned colors, saving and sorting the class list, and clearing temporary data.
3.1.2 User Entering the Classification Manually
Luma User Journey
The user is prompted to fill out a form for each class ID, class name, and hex color code.
The system stores each class entry individually as it is added.
All added classes are displayed in a summary table for preview.
The user can edit or delete the classes in the summary table preview.
The user is prompted to finalize the scheme by clicking a button.
NoteSuccess NotificationThe system shows a confirmation if the classification table is successfully saved to the system.
Luma Geospatial Engine
This is a part of System Response 2.1.b: Manually define classification scheme
The system validates user-provided class input for numeric ID, non-empty class name, and uniqueness (if adding new classes).
TipRelated Functionsclassification_scheme.LULC_scheme_Manager.validate_class_input(): Validates class ID and name, checks for uniqueness, and returns a validity flag with an error message if invalid.classification_scheme.LULC_scheme_Manager.add_class(): Adds a new class or updates an existing class, validates inputs, assigns colors, sorts classes, and updates the next available ID.The system normalizes class name inputs through a sequential process: it first applies Unicode normalization using the NFKD form, converts all characters to lowercase, replaces common separators (
_,-) with spaces, removes non-alphanumeric characters, collapses multiple consecutive spaces, and applies light lexical normalization to reduce superficial grammatical differences, such as singular versus plural forms (e.g. “forest” and “forests”). Missing values (NoneorNA) are returned as None. Optionally, words within the class name can be sorted alphabetically to enable order-independent matching (e.g. “Forest Mixed” = “Mixed Forest”)Temporary edit mode flags are managed to differentiate between adding and updating classes.
TipRelated Functionsclassification_scheme.LULC_scheme_Manager.edit_class()classification_scheme.LULC_scheme_Manager.delete_class()classification_scheme.LULC_scheme_Manager.cancel_edit()
3.1.3 User Selecting a Default Classification Scheme
Luma User Journey
The user is prompted to select a default classification scheme. In the current development, only classification scheme from RESTORE+ is available.
The user is given the option to choose only a specific subset of the default classes, rather than being required to utilize the entire set.
The user is prompted to finalize the scheme by clicking a button.
NoteSuccess NotificationThe system shows a confirmation if the classification table is successfully saved to the system.
Luma Geospatial Engine
This is a part of Response System 2.1.c: Using default classification scheme
The system loads the chosen classification scheme classes.
TipRelated Functionsclassification_scheme.LULC_scheme_Manager.load_default_scheme(): to load an existing classification scheme from a dataset.classification_scheme.LULC_scheme_Manager.get_default_schemes(): stores the RESTORE+ LULC class in a dictionary.If the user selects a subset of the default classes, the system stores the selection into a variable that will be used for the reclassification process in Module 6.
TipRelated Functionsclassification_scheme.LULC_scheme_Manager.store_classes_of_interest(): to store the user’s class of interest as a variable that will be used for the reclassification process in Module 6.
3.2 Saving and Downloading the LULC Classification Table
3.2.1 Saving and Downloading the LULC Classification Table
Luma User Journey
This is a part of User Journey 2.2: Saving and Downloading the LULC Classification Table
The user can optionally download the table in
.csvfile format and save it in their local device.The system gets a confirmation of the number of classes saved in the system.
The user is given the option to proceed to Module 3.
ImportantError Handling NotificationThe system disables the option to continue to the next module if the system does not detect a satellite imagery saved inside the system.
Luma Geospatial Engine
This is a part of System Response 2.2: Save LULC Classification Table and Continue to Next Module
The system generates a
.csvfile containing the final LULC classification scheme table.TipRelated Functionsclassification_scheme.LULC_scheme_Manager.get_csv_data(): to generate a.csvfile containing the final classification table that has been standardized byget_dataframe.classification_scheme.LULC_scheme_Manager.get_dataframe(): to standardize the column names of the LULC classification table to “ID”, “Land Cover Class”, “Color Palette”The system checks whether the user has defined at least one class.
TipRelated Functionsclassification_scheme.LULC_scheme_Manager.has_classes(): to check if any classes are defined.classification_scheme.LULC_scheme_Manager.get_class_count(): get the information of the number of the defined classes.The system saved the LULC class classification scheme as an object to be loaded in the next modules.