Opened 12 years ago

Closed 12 years ago

#3262 closed defect (fixed)

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


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:

results in a crash.

Change History (2)

comment:1 Changed 12 years ago by warmerdam

Cc: gaopeng esrixz added
Status: newassigned

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).

comment:2 Changed 12 years ago by warmerdam

Resolution: fixed
Status: assignedclosed

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.