OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.94k stars 2.57k forks source link

Failing srs tests when building with ECW #10526

Open imincik opened 4 months ago

imincik commented 4 months ago

What is the bug?

Following tests are failing when GDAL is built with ECW.

Errors:

_________________________________ test_ecw_22 __________________________________

gdal> E       AssertionError: did not get expected SRS.
gdal> E       assert 0
gdal> E        +  where 0 = <bound method SpatialReference.IsSame of <osgeo.osr.SpatialReference; proxy of <Swig Object of type 'OSRSpatialReferenceShadow *' at 0x7ffee1cd0d80> >>(<osgeo.osr.SpatialReference; proxy of <Swig Object of type 'OSRSpatialReferenceShadow *' at 0x7ffee1cd1050> >)
gdal> E        +    where <bound method SpatialReference.IsSame of <osgeo.osr.SpatialReference; proxy of <Swig Object of type 'OSRSpatialReferenceShadow *' at 0x7ffee1cd0d80> >> = <osgeo.osr.SpatialReference; proxy of <Swig Object of type 'OSRSpatialReferenceShadow *' at 0x7ffee1cd0d80> >.IsSame
gdal> E        +      where <osgeo.osr.SpatialReference; proxy of <Swig Object of type 'OSRSpatialReferenceShadow *' at 0x7ffee1cd0d80> > = <bound method Dataset.GetSpatialRef of <osgeo.gdal.Dataset; proxy of <Swig Object of type 'GDALDatasetShadow *' at 0x7ffee1cd2370> >>()
gdal> E        +        where <bound method Dataset.GetSpatialRef of <osgeo.gdal.Dataset; proxy of <Swig Object of type 'GDALDatasetShadow *' at 0x7ffee1cd2370> >> = <osgeo.gdal.Dataset; proxy of <Swig Object of type 'GDALDatasetShadow *' at 0x7ffee1cd2370> >.GetSpatialRef
gdal> /build/source/build/autotest/gdrivers/ecw.py:714: AssertionError

_________________________________ test_ecw_25 __________________________________
gdal> E       AssertionError: assert 'epsg:32631' == 'NUTM31'
gdal> E
gdal> E         - NUTM31
gdal> E         + epsg:32631
gdal> /build/source/build/autotest/gdrivers/ecw.py:812: AssertionError

_________________________________ test_ecw_26 __________________________________
gdal> E       AssertionError: assert 'epsg:32631' == 'NUTM31'
gdal> E
gdal> E         - NUTM31
gdal> E         + epsg:32631
gdal> /build/source/build/autotest/gdrivers/ecw.py:852: AssertionError

Steps to reproduce the issue

GDAL is built with following cmake flag -DECW_ROOT=hexagon/ERDAS-ECW/Desktop_Read-Only .

Versions and provenance

Additional context

No response

rouault commented 4 months ago

They don't fail for me. I've no theory why it would fail for you

For reference, here's my debug output:

$ CPL_DEBUG=ON pytest autotest/gdrivers/ecw.py::test_ecw_25 --capture=no -ra -vv
/home/even/.local/lib/python3.8/site-packages/pytest_benchmark/logger.py:46: PytestBenchmarkWarning: Benchmarks are automatically disabled because xdist plugin is active.Benchmarks cannot be performed reliably in a parallelized environment.
  warner(PytestBenchmarkWarning(text))
Test session starts (platform: linux, Python 3.8.10, pytest 7.2.0, pytest-sugar 0.9.4)
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/even/gdal/gdal/build_cmake/.hypothesis/examples')
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Test order randomisation NOT enabled. Enable with --random-order or --random-order-bucket=<bucket_type>
GDAL Build Info:
  PAM_ENABLED: YES
  OGR_ENABLED: YES
  CURL_ENABLED: YES
  CURL_VERSION: 7.68.0
  GEOS_ENABLED: YES
  GEOS_VERSION: 3.13.0dev-CAPI-1.18.0
  PROJ_BUILD_VERSION: 9.5.0
  PROJ_RUNTIME_VERSION: 9.5.0
  COMPILER: GCC 9.4.0
GDAL_DOWNLOAD_TEST_DATA: undefined (tests relying on downloaded data may be skipped)
GDAL_RUN_SLOW_TESTS: undefined (tests marked as "slow" will be skipped)
rootdir: /home/even/gdal/gdal/build_cmake/autotest, configfile: pytest.ini
plugins: hypothesis-6.19.0, benchmark-4.0.0, cov-2.12.1, sugar-0.9.4, random-order-1.1.0, env-0.6.2
collecting ... gdaltest: Deregistering JP2KAK
gdaltest.: Deregistering JP2OpenJPEG
gdaltest.: Deregistering JP2Lura
/home/even/gdal/gdal/build_cmake/data
GDAL: On-demand registering /home/even/gdal/gdal/build_cmake/gdalplugins/gdal_ECW_JP2ECW.so using GDALRegister_ECW_JP2ECW.
ECW: FileInfo: SizeXY=519,512 Bands=1
       OriginXY=6.13856e+06,2.2748e+06  CellIncrementXY=195.512,-198.324
       ColorSpace=1, eCellType=0

ECW: projection=L2CAL6M, datum=NAD83, units=METERS
GDAL: GDALOpen(/tmp/pytest-of-even/pytest-530/test_ecw_250/spif83.ecw, this=0x192c730) succeeds as ECW.
ECW: Rewrite DATUM : WGS84
ECW: Rewrite PROJ : NUTM31
ECW: Rewrite UNITS : FEET
GDAL: GDALClose(/tmp/pytest-of-even/pytest-530/test_ecw_250/spif83.ecw, this=0x192c730)
ECW: FileInfo: SizeXY=519,512 Bands=1
       OriginXY=6.13856e+06,2.2748e+06  CellIncrementXY=195.512,-198.324
       ColorSpace=1, eCellType=0

ECW: projection=NUTM31, datum=WGS84, units=FEET
GDAL: GDALOpen(/tmp/pytest-of-even/pytest-530/test_ecw_250/spif83.ecw, this=0x1bc67c0) succeeds as ECW.
GDAL: GDALClose(/tmp/pytest-of-even/pytest-530/test_ecw_250/spif83.ecw, this=0x1bc67c0)

gdaltest: Registering JP2KAK
gdaltest: Registering JP2OpenJPEG
gdaltest: Registering JP2Lura
 gdrivers/ecw.py::test_ecw_25 ✓                                      
imincik commented 4 months ago

Thank you very much for feedback and log output. I'll investigate more on my side.