Opened 14 months ago

Closed 8 months ago

#1296 closed defect (fixed)

Rasql_Encode in JPEG2000 missing geoference metadata

Reported by: bphamhuu Owned by: bphamhuu
Priority: major Milestone: 10.0
Component: gdal driver Version: development
Keywords: jpeg2000, encode, jp2 Cc: dmisev, pbaumann, pcampalani
Complexity: Medium

Description (last modified by bphamhuu)

test data sample from Dimitar (this sample does not work as in http://rasdaman.org/ticket/1300, but can give the idea of problem).

rasql -q 'select encode((marray i in [0:1,0:5,0:5] values 1f)[1,*:*,*:*], "JPEG2000", "xmin=25.0;xmax=75.5;ymin=-40.5;ymax=75.5;crs=EPSG:4326")' --out file

it only return grid axis (output from encoding eobstest)

rasql -q 'select encode((c) [1,*:*,*:*], "JPEG2000", 

"xmin=25.0;xmax=75.5;ymin=-40.5;ymax=75.5;crs=EPSG:4326") 

from eobstest AS c where oid(c)=1537' --out file
Driver: JPEG2000/JPEG-2000 part 1 (ISO/IEC 15444-1)
Files: test1.jp2
Size is 101, 232
Coordinate System is `'
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  232.0)
Upper Right (  101.0,    0.0)
Lower Right (  101.0,  232.0)
Center      (   50.5,  116.0)
Band 1 Block=101x232 Type=Int16, ColorInterp=Gray

it should be as same as encode in GTIFF

rasql -q 'select encode((marray i in [0:1,0:5,0:5] values 1f)[1,*:*,*:*], "GTIFF", "xmin=25.0;xmax=75.5;ymin=-40.5;ymax=75.5;crs=EPSG:4326")' --out file

and with georeference metadata

{{{Driver: GTiff/GeoTIFF
Files: rasql_1.tif
Size is 6, 6
Coordinate System is:
GEOGCS["WGS 84",

DATUM["WGS_1984",

SPHEROID["WGS 84",6378137,298.257223563,

AUTHORITY["EPSG","7030"]],

AUTHORITY["EPSG","6326"]],

PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]

Origin = (25.000000000000000,75.500000000000000)
Pixel Size = (8.416666666666666,-19.333333333333332)
Metadata:

AREA_OR_POINT=Area

Image Structure Metadata:

INTERLEAVE=BAND

Corner Coordinates:
Upper Left ( 25.0000000, 75.5000000) ( 25d 0' 0.00"E, 75d30' 0.00"N)
Lower Left ( 25.0000000, -40.5000000) ( 25d 0' 0.00"E, 40d30' 0.00"S)
Upper Right ( 75.5000000, 75.5000000) ( 75d30' 0.00"E, 75d30' 0.00"N)
Lower Right ( 75.5000000, -40.5000000) ( 75d30' 0.00"E, 40d30' 0.00"S)
Center ( 50.2500000, 17.5000000) ( 50d15' 0.00"E, 17d30' 0.00"N)
Band 1 Block=6x6 Type=Float32, ColorInterp?=Gray

}}}

Change History (11)

comment:1 Changed 14 months ago by bphamhuu

  • Description modified (diff)

comment:2 follow-up: Changed 14 months ago by dmisev

Please update the outputs and the second query to match the marray example.

comment:3 in reply to: ↑ 2 Changed 14 months ago by bphamhuu

  • Description modified (diff)

comment:4 Changed 14 months ago by dmisev

The problem is with float data, GDAL doesn't seem able to encode float in JPEG2000.

comment:5 Changed 9 months ago by bphamhuu

the problem is JP2000 need a separate metadata file for georeference, so need an workaround to attach both of these files on return.

gdalinfo rasq_11.jp2000
Driver: JP2OpenJPEG/JPEG-2000 driver based on OpenJPEG library
Files: rasq_11.jp2000
       rasq_11.jp2000.aux.xml
Size is 766, 593
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (25.000000000000000,75.500000000000000)
Pixel Size = (0.065926892950392,-0.195615514333895)

comment:6 Changed 9 months ago by dmisev

  • Cc pbaumann added
  • Resolution set to wontfix
  • Status changed from new to closed

Yes; I don't think we would fix this ever, it would require returning more than one results for a single collection.

comment:7 Changed 9 months ago by dmisev

  • Cc pcampalani added

@Piero, I remember you did some work on JPEG2000/GMLJP2, do you maybe have any insight on how to return a georeferenced JPEG2000 from petascope?

comment:8 Changed 9 months ago by dmisev

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Ok I think we figured out the issue, it's a regression where the GMLJP2 handling got lost apparently..

comment:9 Changed 9 months ago by dmisev

  • Owner set to bphamhuu
  • Status changed from reopened to assigned

comment:10 Changed 9 months ago by dmisev

Bang, there are a bunch of jp2 WCS tests in known_fails, they should be investigated and fixed.

comment:11 Changed 8 months ago by dmisev

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.