Opened 10 years ago

Closed 10 years ago

Last modified 10 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

Description

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 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by flupke

comment:1 Changed 10 years ago by flupke

Component: defaultGDAL_Raster
Version: unspecifiedsvn-trunk

comment:2 Changed 10 years ago by warmerdam

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

Chaitanya,

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

comment:3 Changed 10 years ago by chaitanya

Resolution: fixed
Status: newclosed

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

comment:4 Changed 10 years ago by chaitanya

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

Note: See TracTickets for help on using tickets.