Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#3396 closed defect (fixed)

GDALRasterizeLayers only sets the first band from the ATTRIBUTE option

Reported by: flupke Owned by: chaitanya
Priority: normal Milestone:
Component: Algorithms Version: svn-trunk
Severity: normal Keywords: rasterize
Cc: warmerdam


When using the ATTRIBUTE option of GDALRasterizeLayers, the values are read from the attributes table and cast to an array with the & operator.

gvBurnScanline and similar function then receive this value in psInfo->padfBurnValue, and set each band value from this array. The source data being one element long, only the first value is valid, and the siblings are garbage (in my test this gives blueish images instead of grayscale, but I think it may also cause access violations).

Attached is a patch correcting the problem (I can provide an example illustrating the bug if needed).

Attachments (1)

rasterize-layers-by-ATTRIBUTE.patch (1.1 KB ) - added by flupke 14 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by flupke, 14 years ago

Component: defaultGDAL_Raster
Version: unspecifiedsvn-trunk

comment:2 by warmerdam, 14 years ago

Cc: warmerdam added
Component: GDAL_RasterAlgorithms
Keywords: rasterize added
Owner: changed from warmerdam to chaitanya


Please reproduce the problem, review the patch and apply as appropriate. I'd like it retrofit into 1.7 branch too.

comment:3 by chaitanya, 14 years ago

Resolution: fixed
Status: newclosed

Applied the patch and a test in trunk (r18879) and the 1.7 branch (r18880).

comment:4 by chaitanya, 14 years ago

Fixed compile errors due to r18879 and r18880 in r18883 and r18884 respectively.

Note: See TracTickets for help on using tickets.