[gdal-dev] ASCII Gridded XYZ and "Hectare Raster" data (STATPOP and STATENT)

Stefan Keller sfkeller at gmail.com
Sun Apr 21 01:39:59 PDT 2019


Hi,

The Swiss Statistical Office curates well-known datasets informally
called "Hectare Raster" (STATPOP and STATENT) which obviously are
ASCII Gridded XYZ, like this:

"RELI" "X" "Y" "C1" "C2" "C3"
66192542 661900 254200 1 2 3 ...
66192543 661900 254300 1 2 3 ...
66192599 661900 259900 1 2 3 ...
66192600 661900 260000 1 2 3 ...
...

This obviously is a regular gridded X and Y, sorted by X,Y but
obviously also has gaps and more than one  "Z" (C1, C2, C3). Typically
this is converted to a raster format like GeoTIFF and analysed through
map algebra.

Question 1: The GDAL docs (https://www.gdal.org/frmt_xyz.html ) says
"...no missing value is supported.". In fact, I think it supports them
by omitting lines by setting missing "lines" to NODATA.
=> Correct?

Question 2: I think, there is a way (which could be mentioned in the
docs above), to determine the "Z" value to be converted by gdal_grid
explained in "Reading comma separated values"
(https://www.gdal.org/gdal_grid.html#gdal_grid_csv ).
So XYZ in fact is XYZx meaning that potentially there can be many "Z"
in the input file, but only one can be included.
=> What do you think?

Question 3 (the fundamental one): Although XYZ format requires to
contain regular gridded coordinates, it's technically handled the same
as irregular coordinates (without interpolation) - at least regarding
the main task to convert an sparse array of values to a raster format.
=> Correct?

:Stefan


More information about the gdal-dev mailing list