Opened 8 years ago

Closed 7 years ago

#1296 closed defect (fixed)

Rasql_Encode in JPEG2000 missing geoference metadata

Reported by: Bang Pham Huu Owned by: Bang Pham Huu
Priority: major Milestone: 10.0
Component: gdal driver Version: development
Keywords: jpeg2000, encode, jp2 Cc: Dimitar Misev, Peter Baumann, Piero Campalani
Complexity: Medium

Description (last modified by Bang Pham Huu)

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 by Bang Pham Huu, 8 years ago

Description: modified (diff)

comment:2 by Dimitar Misev, 8 years ago

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

in reply to:  2 comment:3 by Bang Pham Huu, 8 years ago

Description: modified (diff)

comment:4 by Dimitar Misev, 8 years ago

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

comment:5 by Bang Pham Huu, 8 years ago

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 by Dimitar Misev, 8 years ago

Cc: Peter Baumann added
Resolution: wontfix
Status: newclosed

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

comment:7 by Dimitar Misev, 8 years ago

Cc: Piero Campalani 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 by Dimitar Misev, 8 years ago

Resolution: wontfix
Status: closedreopened

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

comment:9 by Dimitar Misev, 8 years ago

Owner: set to Bang Pham Huu
Status: reopenedassigned

comment:10 by Dimitar Misev, 8 years ago

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

comment:11 by Dimitar Misev, 7 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.