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

  1. LULC list of classes to be applied in the final classification result

Process

ImportantError Handling Notification

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

  1. The user is given the options of creating the classification scheme:
    1. Upload the classification scheme
    2. Manually define the scheme on the UI
    3. 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

  1. The user is prompted to upload the .csv file containing the classification scheme information.

  2. The system displays a guidance notification indicating that the uploaded .csv file 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.

  3. 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.

  4. The user is prompted to finalize the scheme by clicking a button.

    NoteSuccess Notification

    The system shows a confirmation if the classification table is successfully saved to the system.

    ImportantError Handling Notification

    The 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

  1. 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 Functions

    classification_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”
  2. The system validates the uploaded .csv to 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 Functions

    classification_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

  1. The user is prompted to fill out a form for each class ID, class name, and hex color code.

  2. The system stores each class entry individually as it is added.

  3. All added classes are displayed in a summary table for preview.

  4. The user can edit or delete the classes in the summary table preview.

  5. The user is prompted to finalize the scheme by clicking a button.

    NoteSuccess Notification

    The 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

  1. The system validates user-provided class input for numeric ID, non-empty class name, and uniqueness (if adding new classes).

    TipRelated Functions

    classification_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.

  2. 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 (None or NA) 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”)

  3. Temporary edit mode flags are managed to differentiate between adding and updating classes.

    TipRelated Functions

    classification_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

  1. The user is prompted to select a default classification scheme. In the current development, only classification scheme from RESTORE+ is available.

  2. 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.

  3. The user is prompted to finalize the scheme by clicking a button.

    NoteSuccess Notification

    The 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

  1. The system loads the chosen classification scheme classes.

    TipRelated Functions

    classification_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.

  2. 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 Functions

    classification_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

  1. The user can optionally download the table in .csv file format and save it in their local device.

  2. The system gets a confirmation of the number of classes saved in the system.

  3. The user is given the option to proceed to Module 3.

    ImportantError Handling Notification

    The 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

  1. The system generates a .csv file containing the final LULC classification scheme table.

    TipRelated Functions

    classification_scheme.LULC_scheme_Manager.get_csv_data() : to generate a .csv file containing the final classification table that has been standardized by get_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”

  2. The system checks whether the user has defined at least one class.

    TipRelated Functions

    classification_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.

  3. The system saved the LULC class classification scheme as an object to be loaded in the next modules.