Opened 13 years ago

Closed 12 years ago

#4187 closed defect (fixed)

Open a .ecw with EPSG PCS/GCS code -1 fails

Reported by: bkrangnes Owned by: warmerdam
Priority: normal Milestone: 1.9.0
Component: GDAL_Raster Version: 1.8.1
Severity: normal Keywords: EPSG -1 ECW SWIG Exception
Cc:

Description

We use Gdal 1-8-1 and the following code to open an .ecw file with :

OSGeo.GDAL.Gdal.Open(fileName, 0) The following error is returned:

“EPSG PCS/GCS code -1 not found in EPSG support files. Is this a valid EPSG coordinate system?”

Gdalinfo reports the following on the .ecw file: ERROR 6: EPSG PCS/GCS code -1 not found in EPSG support files. Is this a valid EPSG coordinate system?

When using an older version of gdal the .ecw file is opened ok.

Is -1 a valid code to use or is gdal not handling this correctly?

Change History (5)

comment:1 by warmerdam, 13 years ago

Status: newassigned

-1 is not a valid EPSG code, but it should not be a fatal error. The problem is that an error is issued, and the SWIG Bindings are throwing an exception even though the open actually worked. The usual way of dealing with this is to clear such errors when we don't want to treat them as serious.

I will try to fix this. Are you in a position to rebuild with a small code change? I can't think of any workaround.

comment:2 by warmerdam, 13 years ago

Keywords: ECW SWIG Exception added; in .ecw file removed

comment:3 by warmerdam, 13 years ago

Actually, to confirm, you are getting a fatal exception from the Open() method, right? Or were you just concerned about the reported runtime error? What language are you working in? Java?

in reply to:  3 comment:4 by bkrangnes, 13 years ago

Replying to warmerdam:

Actually, to confirm, you are getting a fatal exception from the Open() method, right? Or were you just concerned about the reported runtime error? What language are you working in? Java?

I get a fatal exception from the Open() method and use C#. I am not in a position to rebuild.

comment:5 by Even Rouault, 12 years ago

Milestone: 1.9.0
Resolution: fixed
Status: assignedclosed

r23321 /trunk/gdal/frmts/ecw/ecwdataset.cpp: ECW: allow to open a ECW file with invalid EPSG code from SWIG bindings (#4187)

Tested with a file produced with :

gdal_translate byte.tif foo.ecw -of ECW -outsize 128 128 -co PROJ=EPSG:-1  -a_srs "EPSG:-1"
Note: See TracTickets for help on using tickets.