Ticket #4187 (closed defect: fixed)

Opened 22 months ago

Last modified 19 months ago

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

  Changed 22 months ago by warmerdam

  • status changed from new to assigned

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

  Changed 22 months ago by warmerdam

  • keywords ECW SWIG Exception added; in .ecw file removed

follow-up: ↓ 4   Changed 22 months ago by 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?

in reply to: ↑ 3   Changed 22 months ago by bkrangnes

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.

  Changed 19 months ago by rouault

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

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.