DPTPM
DPTPM

Reputation: 1

Gdal Rasterize inserts unwanted line of null values in raster misaligning subsequent rows

I'm using GDAL.rasterize to rasterize a simple shapefile of points. The shapefile points simply consists of Xco-ord, Yco-ord and an integer data value. Everything about the output file is fine except for a single row containing only No_data inserted mysteriously by the process about 3/4 way down the raster and hence all subsequent rows below that then appear misaligned by 100m southward. but data exists in shapefile for that anomalous row ?

I have tried creating other formats instead of TIFF, such as EHDr, but they all turn out the same

So, thinking it was memory related I tried reducing he extent

I took a thin sliver of the extent reducing the number of cols but keeping the rows, same thing occurred.

So I don't think its memory related any longer

The output raster is a simple 6256 cols by 12361 rows tiff in 100mx100m grid

Extent is 45080,670080,4355,1240255 CRS is EPSG: 27700

This is the Gdal .rasterise switches I used

gdal_rasterize -l !fileOUT!  -a OP_DATAFIELD -tr 100.0 100.0 -a_nodata -9999 -te 44780.0 4155.0 670380.0 1240255.0 -ot Int16  C:\WorkingMDT\!SHPfileIN!.shp C:\WorkingMDT\!fileOUT!.tiff

What I need to happen is a raster without the anomalous row 3/4 way down it that is offsetting all subsequent rows,

What's causing that anomalous row to be inserted?

Now I can manually correct this by converting to .asc and editing out the anomaly row but id rather find the programmatic cause

All help and consideration much appreciated. Here is a screenshot of the issue Green is the raster created, blue crosses the original data points, the row of no_data that has been inserted and the subsequent downward shift can be clearly seen

enter image description here

Upvotes: 0

Views: 269

Answers (0)

Related Questions