Opened 14 years ago

Closed 13 years ago

#2840 closed enhancement (fixed)

Rasterize/Cutline - include any crossed pixel

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone: 1.7.0
Component: Algorithms Version: unspecified
Severity: normal Keywords: warp rasterize cutline
Cc: vjetly, ysid

Description

Yusuf has requested that the gdalwarp cutline support be extended with an option to include all pixels crossed by the cutline, not only those for which the center of the pixel is within the polygon.

It appears this will require changes to GDALdllImageFilledPolygon() in gdal/alg/llrasterize.cpp. This option would need to be controlled by an option to the GDAL warper. At the same time it might as well be exposed for the regular users of the rasterization API, including the gdal_rasterize command.

Change History (5)

comment:1 by warmerdam, 14 years ago

Cc: vjetly ysid added

comment:2 by warmerdam, 13 years ago

Status: newassigned

Starting work on this in trunk.

comment:3 by warmerdam, 13 years ago

Support for this added in trunk (r17041). The option is enabled with the warp option CUTLINE_ALL_TOUCHED=YES. The ALL_TOUCHED option is also available in the rasterize functions and can be turned on with the -at switch to gdal_rasterize.

Note that "all touched" can act rather unpredictably for polygon edges or lines that fall exactly on pixel boundaries.

comment:4 by warmerdam, 13 years ago

Some additional documentation added (r17042).

comment:5 by warmerdam, 13 years ago

Milestone: 1.7.0
Resolution: fixed
Status: assignedclosed

Added some minimal testing (r17045).

Note: See TracTickets for help on using tickets.