0

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

if I reduce the extent to only rasterise below the line of the inserted null row , the resultant output is still offset

if I reduce the extent to only rasterise above the row of the inserted null data , the resultant output is fine for that portion as it is when I do the whole 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 programmatical cause

all help and consideration much appreciated. Here is a picture 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 seenenter image description here

DPTPM
  • 1
  • 2
  • Welcome to stackoverflow. Please read [ask] and edit your question – betontalpfa Apr 24 '19 at 12:23
  • Did you try opening your shapefile in some GIS tool like QGIS? May be the original file is like this only. Can you share your original shape file with all the supporting files? – Surabhi Mundra Apr 25 '19 at 06:18

0 Answers0