Opened 6 years ago
Closed 6 years ago
#7261 closed defect (fixed)
GDAL XYZ Driver not recognising header field names
Reported by: | aharfoot | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.3.0 |
Component: | Utilities | Version: | 2.2.3 |
Severity: | normal | Keywords: | |
Cc: |
Description
I'm trying to translate gridded XYZ data files into GeoTIFFs using gdal_translate. The files do not have the data in the conventional X,Y,Z order however (it's Y,X,-,-,-,-,Z), and to avoid having to reorder columns I hoped to use the header parsing functionality documented here http://www.gdal.org/frmt_xyz.html
I have tried the data file with TAB, space and comma separators, and all three of the suggested column name variants, but the output of gdalinfo and gdal_translate suggests that GDAL is ignoring the header row and assuming a XYZ column order in each case.
I am using GDAL 2.23 installed through the OSGeo4W package installer, on Win10 x64.
Change History (6)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Apparently the issue is if you have non-numeric values in the columns that are ignored
comment:3 by , 6 years ago
Following is OK
Y X - Z 3751290 440750 0 107 3751290 440810 0 123 3751230 440750 0 115 3751230 440810 0 132
but following is not
Y X - Z 3751290 440750 x 107 3751290 440810 0 123 3751230 440750 0 115 3751230 440810 0 132
comment:4 by , 6 years ago
That makes sense, the ignored columns are numeric, but have 'NaN' values (which have just tripped me up whilst scripting a workaround!)
comment:6 by , 6 years ago
Milestone: | → 2.3.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in git master per https://github.com/OSGeo/gdal/commit/feba3e02b56cfd80e5e98cfd3a822fad3bf521ba
I had a try with these minimal files with one space as a separator:
In both cases gdalinfo gives the same result so it does seem to me that the header line is read and used correctly.
Gdal-dev mailing list is the primary forum for questions but if you can provide with test data that does not behave correctly you can add that as an attachment to this ticket.