SNAP fails openning JP2OpenJPEG EPSG:4326 images

Hello

I am experiencing problems to open JP2OpenJPEG images in SNAP (9.0.4) on Linux Ubuntu 22.04. The images were produced using gdal python API. Sentinel 2 UTM RGB jp2 images, derived from GeoTIFF files, are correctly openned in SNAP. However, Sentinel 1 EPSG:4326, derived from ENVI format image contained inside Terrain Corrected BEAM-DIMAP folder, are not (please find enclosed the Exception message window snapshot). These Sentinel 1 jp2 images, are correcty oppened in QGIS (3.22.4, that uses GDAL 3.4.1) or OTB-monteverdi (OTB 8.1.1, that uses GDAL 3.4.2).

I also tried to open them using SeaDAS 8.3 producing the same exception.

This is an example of gdalinfo output (GDAL 3.4.1,):

gdalinfo S1A_20230222_Noise-Cor_Asm_Orb_Cal_Spk_TC.jp2
Driver: JP2OpenJPEG/JPEG-2000 driver based on OpenJPEG library
Files: S1A_20230222_Noise-Cor_Asm_Orb_Cal_Spk_TC.jp2ple of gdalinfo (GDAL 3.4.1,) the Sentinel 1 jp2 images
gdalinfo S1A_20230222_Noise-Cor_Asm_Orb_Cal_Spk_TC.jp2
Driver: JP2OpenJPEG/JPEG-2000 driver based on OpenJPEG library
Files: S1A_20230222_Noise-Cor_Asm_Orb_Cal_Spk_TC.jp2
Size is 39044, 50753
Coordinate System is:
GEOGCRS[“WGS 84”,
DATUM[“World Geodetic System 1984”,
ELLIPSOID[“WGS 84”,6378137,298.257223563,
LENGTHUNIT[“metre”,1]]],
PRIMEM[“Greenwich”,0,
ANGLEUNIT[“degree”,0.0174532925199433]],
CS[ellipsoidal,2],
AXIS[“geodetic latitude (Lat)”,north,
ORDER[1],
ANGLEUNIT[“degree”,0.0174532925199433]],
AXIS[“geodetic longitude (Lon)”,east,
ORDER[2],
ANGLEUNIT[“degree”,0.0174532925199433]],
ID[“EPSG”,4326]]SNAP fails openning JP2OpenJPEG EPSG:4326 images
Data axis to CRS axis mapping: 2,1
Origin = (-15.771334021843463,30.848224086451186)
Pixel Size = (0.000089831528412,-0.000089831528412)
Corner Coordinates:
Upper Left ( -15.7713340, 30.8482241) ( 15d46’16.80"W, 30d50’53.61"N)
Lower Left ( -15.7713340, 26.2890045) ( 15d46’16.80"W, 26d17’20.42"N)
Upper Right ( -12.2639518, 30.8482241) ( 12d15’50.23"W, 30d50’53.61"N)
Lower Right ( -12.2639518, 26.2890045) ( 12d15’50.23"W, 26d17’20.42"N)
Center ( -14.0176429, 28.5686143) ( 14d 1’ 3.51"W, 28d34’ 7.01"N)
Band 1 Block=1024x1024 Type=Byte, ColorInterp=Gray
Overviews: 19522x25377, 9761x12689, 4881x6345
Overviews: arbitrary
Image Structure Metadata:
COMPRESSION=JPEG2000

Regards
Josep

Hello Josep,
Can you share your JP2 file somehow? (e.g. wetransfer)
It would be easier to directly test with it.

I shared using wetransfer an example of Sentinel 1 jp2 image

Do you have a transfer link?

The wetransfer link

Josp

Thanks, I reproduced it. We will look into it and get back to you.
Ticket SNAP-3459 created.

For a better understanding, the axis order for this EPSG:4326 should be the one defined here:
https://epsg.org/crs_4326/WGS-84.html
which is (north, east) ~ (latitude, longitude) ~ (y, x)
Your JP2 file (with this EPSG:4326) does not respect this order, it has (x, y) axis order:

<gml:axisName>x</gml:axisName>
<gml:axisName>y</gml:axisName>

The current implementation from SNAP expects the correct axis order for EPSG:4326, hence the error you obtained.

1 Like

Thank you very much for the information
Nevertheless, it is weird that gdal JP2OpenJPEG driver do not manage it properly
Regards