Skip to main content

Create Constant Raster

Overview​

This tool creates a raster layer with a uniform value for all valid cells based on the specified analysis extent and cell size. It can be used as a background raster, a mask, or an initialized input for subsequent spatial analysis.

Use Cases​

  • Initialize constant input parameters in geographic models, such as an initial elevation value.
  • Use in calculations with other rasters, such as weighted overlay.
  • Create mask or spatial constraint layers.
  • Simulate variable effects under uniformly distributed conditions.

Parameters​

ParameterDescriptionNotes
Constant valueThe value assigned to all valid cells in the output raster.Default: 10
Number of bandsThe number of bands in the output raster.Default: 1
Output typeWhen saving raster data, you can manually set raster output parameters or use a snap raster to match the parameters of a reference raster.See common raster output.
Output fileSpecifies the storage location, file name, data format, data type, and NoData value of the output raster data.See common raster output.

Steps​

  1. Start the tool

    Open the Raster Basic Tools toolbox, go to Raster Data > Create Raster, and start the Create Constant Raster tool pane.

  2. Set the raster value

    • Constant value: Enter the target value, such as 50. This value is assigned to all cells.
    • Number of bands: The default is 1.
  3. Configure raster spatial properties

    • In the Output type drop-down list, select a configuration mode:
      • Manual input: Manually define the Output coordinate system, spatial Extent, and Cell size.
      • Use vector data: Select an existing vector layer. The system automatically reads its coordinate system and extent.
      • Use raster data: Select a reference raster. The system fully inherits its coordinate system, extent, cell size, and other spatial structure settings.
    • Optionally configure Snap to raster to force the output grid to align exactly with a specific reference raster.
  4. Set the output file and raster properties

    • Click the button next to Output file, specify the output path, and enter the file name.
    • Configure Data type based on the value range, such as single-precision floating point or double-precision floating point.
    • Set the NoData value. The default is Auto, but you can customize it for analysis requirements.
    • Select Compression type. Keeping the default LZW compression is recommended to balance storage space and read/write efficiency.
  5. Generate the raster

    • Click Run at the bottom of the window.
    • After the task is completed, the constant raster is saved to the specified location and is usually loaded automatically into the current project.

Notes​

  • Spatial parameters:

    • Set the analysis extent explicitly. It is recommended to obtain it from a layer or enter it manually.
    • Cell size is the raster resolution. A cell size that is too large reduces precision, while one that is too small affects performance and storage efficiency. It should match the analysis requirements.
    • Use the same coordinate system as the objects used in subsequent analysis to avoid offsets in spatial overlay.
  • Data properties:

    • The default data type is double-precision floating point. If integer values are used, specify an integer data type to avoid unnecessary precision or value overflow.
    • Enter an explicit input value so that the value meaning is clear.
    • The default NoData value is the maximum value supported by the data type, but you can also enter a custom value.