Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5326 closed defect (fixed)

Writing/Reading GCPZ to/from .aux.xml

Reported by: oleinik Owned by: Even Rouault
Priority: normal Milestone: 1.10.2
Component: GDAL_Raster Version: 1.10.1
Severity: major Keywords:
Cc:

Description

I have raster file with GCPs points including "Z"-coorinate. After calling GDALSetGCPs with my points I'v got attached file "1.bmp.aux.xml". After calling GDALGetGCPs I have Z=0 on every points. Gdalinfo.log also attached.

I think that because different xml attribute used during write/read aux.xml file

GDALPamDataset::SerializeToXML: if( psGCP->dfGCPZ != 0.0 )

CPLSetXMLValue( psXMLGCP, "#GCPZ",

oFmt.Printf( "%.12E", psGCP->dfGCPZ ) );

GDALPamDataset::XMLInit: psGCP->dfGCPZ = atof(CPLGetXMLValue(psXMLGCP,"Z","0.0"));

Attachments (2)

1.bmp.aux.xml (504 bytes) - added by oleinik 4 years ago.
gdalinfo.log (816 bytes) - added by oleinik 4 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by oleinik

Attachment: 1.bmp.aux.xml added

Changed 4 years ago by oleinik

Attachment: gdalinfo.log added

comment:1 Changed 4 years ago by Even Rouault

Owner: changed from warmerdam to Even Rouault

comment:2 Changed 4 years ago by Even Rouault

Milestone: 1.10.2
Resolution: fixed
Status: newclosed

Good catch.

trunk r26727 "PAM .aux.xml and VRT: serialize Z component of a GCP as 'Z' attribute, for consistency, instead of GCPZ that could not be read back previously. In reading code, try reading 'Z' and if not found try 'GCPZ' (#5326)"

branches/1.10 r26728 "PAM .aux.xml and VRT: recognize 'GCPZ' attribute of GCP, in addition to 'Z', since 'GCPZ' is what we currently generate. But GDAL 1.11/2.0 will generate 'Z' for consistency (#5326)"

comment:3 Changed 4 years ago by Even Rouault

branches/1.10 r26729 "Commit forgotten file (#5326)"

comment:4 Changed 4 years ago by oleinik

I have found similar bug in another files: alg\gdal_tps.cpp alg\gdal_crs.c

comment:5 Changed 4 years ago by Even Rouault

trunk r26731 "Remove duplicated serialization and deserialization of GCP list that was found in 4 instances in the code base... So now TPS and Polynomial GCP transformation have the Z component of their GCPs properly serialized/deserialized (#5326)"

branches/1.10 r26732 "TPS and Polynomial GCP transformations: recognize 'GCPZ' attribute of GCP, in addition to 'Z', since 'GCPZ' is what we currently generate. But GDAL 1.11/2.0 will generate 'Z' for consistency (#5326)"

Note: See TracTickets for help on using tickets.