Opened 13 years ago

Closed 12 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


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 Changed 13 years ago by warmerdam

Cc: vjetly ysid added

comment:2 Changed 12 years ago by warmerdam

Status: newassigned

Starting work on this in trunk.

comment:3 Changed 12 years ago by warmerdam

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 Changed 12 years ago by warmerdam

Some additional documentation added (r17042).

comment:5 Changed 12 years ago by warmerdam

Milestone: 1.7.0
Resolution: fixed
Status: assignedclosed

Added some minimal testing (r17045).

Note: See TracTickets for help on using tickets.