Ticket #3262 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Problem setting coordinate system on some minimal .img files

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone: 1.7.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: HFA
Cc: gaopeng, esrixz

Description

Attempting the script:


from osgeo import gdal

ds = gdal.Open('float-rle.img',gdal.GA_Update)

wkt = 'PROJCS["Pulkovo 1942 / 3-degree Gauss-Kruger zone 39",GEOGCS["Pulkovo 1942",DATUM["Pulkovo_1942",SPHEROID["Krassowsky 1940",6378245,298.3]],PRIMEM["Greenwich",0],UNIT["degree",0.01745329251994328]],UNIT["metre",1],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",1],PARAMETER["false_easting",39500000],PARAMETER["false_northing",0]]'

ds.SetProjection( wkt )

ds = None

script on the file:

 http://download.osgeo.org/gdal/data/hfa/float-rle.img

results in a crash.

Change History

Changed 3 years ago by warmerdam

  • cc gaopeng, esrixz added
  • status changed from new to assigned

The problem seems to be that several data types are missing from the file that we assumed were always available. The apszDefDefn[] array of backup dictionary entries has been extended and then things work. The problem is new in trunk were we added support for extending the dictionary on existing files and various mechanisms to write out data type projections to existing files recently. The change is in trunk (r18184).

Changed 3 years ago by warmerdam

  • status changed from assigned to closed
  • resolution set to fixed

I have confirmed that this fixes the problem with the original file the problem was reported relative to, and I have backported the fix into 1.6-esri (r18185).

Note: See TracTickets for help on using tickets.