Bug report #13169

Georeferencer produces invalid Geotiff Information in some cases

Added by Adam Szieberth about 5 years ago. Updated about 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:C++ plugins/Georeferencer
Affected QGIS version:2.6.1 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:21232

Description

In some cases the georeferencer produces invalid Geotiff Information. I attached an example TIFF file for georeferencing. Georeferencer settings: Helmert; Lanczos;LZW;SRS:"EPSG:23700".

[Z:\\GIS\\adam_szkriptek]"C:\\Program Files\\QGIS Brighton\\bin\\listgeo.exe" 0.tif
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                0                0
         553955.398797477 82861.388376936  0
      ModelPixelScaleTag (1,3):
         0.08849110111781320.08849110111781320
      End_Of_Tags.
   Keyed_Information:
      GTModelTypeGeoKey (Short,1): ModelTypeProjected
      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
      GTCitationGeoKey (Ascii,11): "HD72 / EOV" 
      GeogCitationGeoKey (Ascii,5): "HD72" 
      GeogAngularUnitsGeoKey (Short,1): Angular_Degree
      ProjectedCSTypeGeoKey (Short,1): PCS_HD72_EOV
      ProjLinearUnitsGeoKey (Short,1): Linear_Meter
      End_Of_Keys.
   End_Of_Geotiff.

PCS = 23700 (name unknown)
Projection Linear Units: 9001/metre (1.000000m)

Corner Coordinates:
Upper Left    (  553955.399,   82861.388)
Lower Left    (  553955.399,   82624.675)
Upper Right   (  554427.499,   82861.388)
Lower Right   (  554427.499,   82624.675)
Center        (  554191.449,   82743.032)

Here ModelPixelScaleTag format is invalid due to the many decimal places. Writing it back to the tif with geotifcp -g and printing it again produces the following:

[Z:\\GIS\\adam_szkriptek]"C:\\Program Files\\QGIS Brighton\\bin\\listgeo.exe" 0.uj.tif
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                0                0
         553955.398797477 82861.388376936  0
      ModelPixelScaleTag (1,3):
         0.08849110111781320                0
      End_Of_Tags.
   Keyed_Information:
      GTModelTypeGeoKey (Short,1): ModelTypeProjected
      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
      GTCitationGeoKey (Ascii,11): "HD72 / EOV" 
      GeogCitationGeoKey (Ascii,5): "HD72" 
      GeogAngularUnitsGeoKey (Short,1): Angular_Degree
      ProjectedCSTypeGeoKey (Short,1): PCS_HD72_EOV
      ProjLinearUnitsGeoKey (Short,1): Linear_Meter
      End_Of_Keys.
   End_Of_Geotiff.

PCS = 23700 (name unknown)
Projection Linear Units: 9001/metre (1.000000m)

Corner Coordinates:
Upper Left    (  553955.399,   82861.388)
Lower Left    (  553955.399,   82861.388)
Upper Right   (  554427.499,   82861.388)
Lower Right   (  554427.499,   82861.388)
Center        (  554191.449,   82861.388)

As you can see all the second coordinates became identical due to the second pixelscale become zero.

As a workaround, manually rounding the original ModelPixelScaleTags solves the issue:

      ModelPixelScaleTag (1,3):
         0.08849110111781 0.08849110111781 0   

example.tif (1.41 MB) Adam Szieberth, 2015-07-29 08:00 AM

example.tif.points (152 Bytes) Adam Szieberth, 2015-07-29 08:00 AM

History

#1 Updated by Giovanni Manghi about 5 years ago

  • Status changed from Open to Feedback
  • Category set to C++ plugins/Georeferencer

There have been fixes in the georeferencer in the latest qgis version, 2.10, please give it a try and report back.

#2 Updated by Adam Szieberth about 5 years ago

Sure, please give me 2-3 weeks.

#3 Updated by Adam Szieberth about 5 years ago

Issue is fixed in 2.10. We switch to the new version. Thanks!

#4 Updated by Adam Szieberth about 5 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF