Skip to content

gdal_rasterize all_touched not working as expected #12129

Closed
@johanvdw

Description

@johanvdw

What is the bug?

gdal_rasterize with the option all-touched no longer correctly converts all pixels.

The image below shows:

  • the shapefile
  • dark blue - the resulting raster
  • pink: the two pixels which are missing

The problem does not occur in version 3.5.1, but occurs in version 3.6.2 and current master.

Image

Steps to reproduce the issue

Command to reproduce

gdal_rasterize -q -a_nodata -9999 -at -burn 1 -l mask -of GTiff -te 163600 167680 164000 168000 -tr 20 20 -co COMPRESS=DEFLATE mask.shp mask.tif

gdal-rasterize.zip

Versions and provenance

  • versions 3.5.1 (correct) (compiled from source in debian linux)
  • version 3.6.2 (incorrect) (debian bookworm package)
  • version GDAL 3.11.0dev-c4a2e0b926: incorrect (compiled from source in debian linux)

Additional context

originally reported by @Sachagobeyn in watem-sedem/pywatemsedem#55

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions