Random points from mask raster layer

This algorithm creates a new point layer with a given number of random points, all of them in the area where the given mask evaluates to true.

Usage:

  1. Start the algorithm from the Processing Toolbox panel.

  2. Select a categorized raster layer to process define the number of points as well as your distance settings. Then click run.

    ../../../../_images/rand_points_from_mask.png

Parameters

Mask raster layer [raster]

A mask raster layer to draw locations from.

Number of points [number]

Number of points to be drawn.

Minimum distance between points (in meters) [number]

A minimum distance between points can be specified. A point will not be added if there is an already generated point within this (Euclidean) distance from the generated location.

Default: 0

Random seed [number]

The seed for the random generator can be provided.

Outputs

Output point layer [vectorDestination]

Vector file destination.

Command-line usage

>qgis_process help enmapbox:RandomPointsFromMaskRasterLayer:

----------------
Arguments
----------------

mask: Mask raster layer
    Argument type:  raster
    Acceptable values:
            - Path to a raster layer
n: Number of points
    Argument type:  number
    Acceptable values:
            - A numeric value
            - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
            - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
distance: Minimum distance between points (in meters)
    Default value:  0
    Argument type:  number
    Acceptable values:
            - A numeric value
            - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
            - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
seed: Random seed (optional)
    Argument type:  number
    Acceptable values:
            - A numeric value
            - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
            - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
outputPoints: Output point layer
    Argument type:  vectorDestination
    Acceptable values:
            - Path for new vector layer

----------------
Outputs
----------------

outputPoints: <outputVector>
    Output point layer