Raster Thinning

Function Description

Raster thinning refers to preprocessing raster data before vectorization to improve speed and accuracy, applicable only when converting raster data to vector line data. This function supports both raster data and image data. The raster to vector operation also provides raster thinning capability, enabling line vectorization refinement for grid/image data. For details about raster to vector functions, see Raster to Vector.

Raster thinning reduces the number of pixels representing polylines in raster data, thereby enhancing vectorization efficiency. Typically used as preprocessing before converting raster to vector line data, it improves conversion quality. For example, a scanned contour map (image data) might display contour lines using 5-6 pixels in width, while after thinning, only 1 pixel width remains.

Before raster thinning After raster thinning

Feature Entry

  • Click Spatial Analysis Tab -> Raster Analysis group -> Vector-Raster Conversion -> Raster Thinning.
  • Toolbox -> Raster Analysis -> Vector-Raster Conversion -> Raster Thinning.

Parameter Description

  • Source Dataset: Set the source data to process. Select the datasource containing raster data and specify the target raster dataset.
  • Configure raster thinning parameters:
    • No Value: Different interpretations apply based on data type:
      • Raster Data: Specifies null values in the result dataset. Pixels set as "No Value" (-9999 by default) are excluded from calculations. During thinning, redundant pixels representing lines will be filled with this value. In iDesktop, click to pick pixel values from open raster datasets, or manually input valid values.
      • Image Data: Specifies pixel values to be treated as null. These pixels are excluded from processing. Default "No Value" depends on the image's pixel format (maximum value of its data range). For example, 24-bit true color images use 16777215 as default. Use the picker tool or manually input values in iDesktop.
    • Tolerances:
      • Raster Tolerance: Sets tolerance range for null values [r-a, r+a], where r is specified null value and a is tolerance.
      • Image Tolerance (iDesktop): Defines RGB tolerance range for image null values. For example, with specified null RGB(250,250,050) and tolerance(R:2,G:2,B:3), pixels within RGB(248,248,252)-RGB(252,252,253) are considered null.
    • Result Data: Configure output parameters. Select target datasource and name the result dataset.

    Application Example

    Open the "Terrain" datasource under "ExerciseData" > "RasterAnalysis", containing rasterized contour line data "RasterForLine". After configuring raster thinning parameters, obtain results as shown:

    Figure: Thin raster result comparison
    Caution:
    • The null value tolerance refers to user-specified value ranges, independent of original null values in raster data.
    • Use the picker tool to ensure correct null value settings. Manually entering nonexistent pixel values may lead to incorrect results or processing failures.