Opened 9 years ago

Last modified 8 years ago

#1318 closed defect

Petacope_CRS_Extension extract 2D CRS from compound CRS (3D, 4D,...) — at Version 1

Reported by: Bang Pham Huu Owned by:
Priority: major Milestone: 9.3
Component: petascope Version: development
Keywords: Cc: Dimitar Misev
Complexity: Medium

Description (last modified by Bang Pham Huu)

Currently, in Petascope, with WCS request and CRS_Extension like

localhost:8080/rasdaman/ows?service=WCS&version=2.0.1&request=GetCoverage&
coverageId=eobstest&format=image/tiff&
subset=t(0)&outputCrs=http://www.opengis.net/def/crs/EPSG/0/3857

The coverage is 3D and slicing in Time axis to 2D and native CRS is 4326, it is valid to project to output 3857. However, in handle class, such as GeotiffFormatExtension.java. What it was done is:

// First, transform possible non-native CRS subsets
CRSExtension crsExtension = (CRSExtension) ExtensionsRegistry.getExtension(ExtensionsRegistry.CRS_IDENTIFIER);
crsExtension.handle(request, m, meta);

//Handle the range subset feature
RangeSubsettingExtension rsubExt = (RangeSubsettingExtension) ExtensionsRegistry.getExtension(ExtensionsRegistry.RANGE_SUBSETTING_IDENTIFIER);
rsubExt.handle(request, m);

So it needs the 2D CRS (4326) from the coverage before the coverage is sliced from 3D to 2D. Then in CrsExtension.java, it will throw error due to the compound CRS like this is not valid

http://localhost:8080/def/crs-compound?1=http://localhost:8080/def/crs/EPSG/0/3857&2=http://localhost:8080/def/crs/OGC/0/AnsiDate"

for GeoTools.JTS library to transform (this library works well, before I had a mistake with parameters then it is transformed to wrong coordiniates).

So, what need to change here:

+ Get the right grid/geo CRS (4326) in compound CRS (it is tricky as the order in compoundCRS is not consistent, e.g: 1=time&2=4326 or 1=4326&2=time)

or

+ Handle the coverage first to make it 2D and in GetCoverageMetadata (somehow it is handled correctly to get only 2D axis (4326)). Then it is input for the CRSExtension class. This is also tricky due to with subsettingCrs, it is needed to project the bounding box before can slice to 2D.

Change History (1)

comment:1 by Bang Pham Huu, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.