Skip to content

Commit 85a3a67

Browse files
committed
Fix heatmap rasters not correctly initialising with NODATA value
1 parent 471dab1 commit 85a3a67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plugins/heatmap/heatmap.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,13 @@ void Heatmap::run()
142142

143143
float* line = ( float * ) CPLMalloc( sizeof( float ) * columns );
144144
for ( int i = 0; i < columns ; i++ )
145+
{
145146
line[i] = NO_DATA;
147+
}
146148
// Write the empty raster
147149
for ( int i = 0; i < rows ; i++ )
148150
{
149-
poBand->RasterIO( GF_Write, 0, 0, columns, 1, line, columns, 1, GDT_Float32, 0, 0 );
151+
poBand->RasterIO( GF_Write, 0, i, columns, 1, line, columns, 1, GDT_Float32, 0, 0 );
150152
}
151153

152154
CPLFree( line );

0 commit comments

Comments
 (0)