Create classification dataset (from categorized vector layer and feature raster)ΒΆ

Create a classification dataset by sampling data for pixels that match the given categories and store the result as a pickle file. If the layer is not categorized, or the field with class values is selected manually, categories are derived from the sampled target data y. To be more precise: i) category values are derived from unique attribute values (after excluding no data or zero data values), ii) category names are set equal to the category values, and iii) category colors are picked randomly.


Categorized vector layer [vector]
Categorized vector layer specifying sample locations and target data y. If required, the layer is reprojected and rasterized internally to match the feature raster grid.
Raster layer with features [raster]
Raster layer used for sampling feature data X.
Field with class values [field]
Field with class values used as target data y. If not selected, the field defined by the renderer is used. If that is also not specified, an error is raised.
Minimum pixel coverage [number]

Exclude all pixel where (polygon) coverage is smaller than given threshold.

Default: 50

Majority voting [boolean]

Whether to use majority voting. Turn off to use simple nearest neighbour resampling, which is much faster, but may result in highly inaccurate class decisions.

Default: True


Output dataset [fileDestination]
Dataset file destination .

Command-line usage

>qgis_process help enmapbox:CreateClassificationDatasetFromCategorizedVectorLayerAndFeatureRaster:


categorizedVector: Categorized vector layer
    Argument type:  vector
    Acceptable values:
            - Path to a vector layer
featureRaster: Raster layer with features
    Argument type:  raster
    Acceptable values:
            - Path to a raster layer
categoryField: Field with class values (optional)
    Argument type:  field
    Acceptable values:
            - The name of an existing field
            - ; delimited list of existing field names
coverage: Minimum pixel coverage
    Default value:  50
    Argument type:  number
    Acceptable values:
            - A numeric value
majorityVoting: Majority voting
    Default value:  true
    Argument type:  boolean
    Acceptable values:
            - 1 for true/yes
            - 0 for false/no
outputClassificationDataset: Output dataset
    Argument type:  fileDestination
    Acceptable values:
            - Path for new file


outputClassificationDataset: <outputFile>
    Output dataset