Skip to content

Rasterize mesh dataset (native:meshrasterize, ger: Netzdatensatz rastern) shifts output raster values by half cell size #62030

@jonpietsch

Description

@jonpietsch

What is the bug or the crash?
The QGIS tool “Netzdatensatz rastern” (native:meshrasterize) assigns mesh dataset values to the output raster shifted by half the assigned cell size.
It appears that mesh values for the raster cells are sampled at the respective "left upper" cell edge, rather than in its middle. This shifting effect is therefore linked to the chosen output cell size (raster resolution).
No error message is shown; the tool completes, but the output raster is shifted. More precisely, the raster values are shifted compared to the input mesh data.

Steps to reproduce the issue:

  1. Open QGIS 3.26 or 3.40.
  2. Use the “Netzdatensatz rastern” tool (native:meshrasterize) on a mesh dataset.
  3. Produce a raster with a known cell size and compare the location of values against the mesh.
  4. Observe that the output raster is shifted by half a cell.

Versions:
QGIS-Codeversion
0aece28

New profile:

  • I tried with a new QGIS profile (please check this if you did).

Additional context:
Tested with QGIS 3.26 and 3.40 (different user profiles).The issue appears consistently. No error messages or logs are generated. The bug does not occur in third-party plugins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugEither a bug report, or a bug fix. Let's hope for the latter!MeshRelated to general mesh layer handling (not specific data formats)ProcessingRelating to QGIS Processing framework or individual Processing algorithms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions