[gdal-dev] Opening gridded xyz data that is out of order

Andreas Neumann a.neumann at carto.net
Mon Sep 11 06:43:47 PDT 2017


Hi,

I received a DTM from a Swiss province (OpenData) which is of the 
following format:

One coordinate per line, already gridded. See f.e.

2708001.00 1218001.00 1541.52
2708003.00 1218001.00 1542.35
2708005.00 1218001.00 1542.98
2708007.00 1218001.00 1543.58
2708009.00 1218001.00 1544.20
2708011.00 1218001.00 1545.13
2708013.00 1218001.00 1545.88

The issue is that further down the file there seems to be an issue of 
ordering the coordinates. gdalinfo produces the following error:

ERROR 1: Ungridded dataset: At line 4125001, change of Y direction
gdalinfo failed - unable to open 'DTM_swissALTI3D_XYZ.txt'.

If GDAL could open the data - it would open as ungridded data - right? 
Issue is, this data is already gridded as you can see above. I actually 
want to save this is a gridded GeoTIFF file for later usage in QGIS.

Is there still a chance that GDAL can open this data set, even if 
coordinates are out of order?

How about the gridded vs ungridded aspect of xyz files?

Thanks,

Andreas





More information about the gdal-dev mailing list