Opened 15 years ago
Closed 15 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 , 15 years ago
Cc: | added |
---|
comment:2 by , 15 years ago
Status: | new → assigned |
---|
comment:3 by , 15 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:5 by , 15 years ago
Milestone: | → 1.7.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Added some minimal testing (r17045).
Starting work on this in trunk.