Opened 9 years ago

Closed 9 years ago

#1260 closed defect (fixed)

Petascope cannot encode coverages that have a CRS containing a ' " ' character (WCST_Import also).

Reported by: Alex Dumitru Owned by: Vlad Merticariu
Priority: major Milestone: 10.0
Component: petascope Version: development
Keywords: Cc: Bang Pham Huu
Complexity: Medium

Description (last modified by Bang Pham Huu)

Due to the way it calls rasdaman, the '"' is interpreted as the end of the query and because of it, it fails.
See in wcps/server/core/EncodeDataExpr.java, the last reference to result.
@Bang please check if this is the case in WCPS 1.5 as well.

Bang: update for better understanding:

So, WCPS 1.5 don't have "" with time Axis-label.

here is an example: WCPS 1.5

for c in (time3d) return encode(c[Lat(-37.5:-35.5), Long(148:149), time("1950-01-02")], "tiff")

Rasql query:

SELECT encode(c[80:179,96:295,1], "GTiff" , 
"xmin=147.2;xmax=152.32;ymin=-39.66;ymax=-34.54;crs=OGC:AnsiDate?axis-label=time")
FROM time3d AS c

WCPS 1.0 have this problem with Rasql:

select encode((c) [80:180,96:296,1], "PNG", 
"xmin=148.0;xmax=149.0;ymin=-37.5;ymax=-35.5;crs=OGC:AnsiDate?axis-label="time"")
from time3d AS c where oid(c)=117761

Change History (8)

comment:1 by Bang Pham Huu, 9 years ago

@Alex: sorry, I did not understand correctly your request. I've tried to get an example with CRS containing (") character, such as "eobstest"

e.g, in time axis, it has

t:http://localhost:8080/def/crs/OGC/0/Temporal?epoch="1950-01-01T00:00:00"&uom="d"

and in WCPS 1.0, I can encode this coverage normally

for c in (eobstest) return encode(extend(c[t(0)], { Long(-45:90),  Lat(5:80) } ), "tiff")

returns Rasql

select encode(extend((c) [0,*:*,*:*],[-140:130,-9:141]), 
"GTiff", 
"xmin=-45.0;xmax=90.0;ymin=5.0;ymax=80.0;crs=EPSG:4326")
 from eobstest AS c where oid(c)=1537

and the coverage without problem.

I've also checked in the toRasQL of wcps/server/core/EncodeDataExpr.java and could not see the error from CRS containing the (") character as in time axis above.

comment:2 by Vlad Merticariu, 9 years ago

To test it in WCPS 1.5, try to import a coverage that has the following crs for the time axis:

http://localhost:8080/def/crs/OGC/0/AnsiDate?axis-label="time"

Then try a WCPS 1.5 query on that coverage (e.g. selecting a time slice), and check if that succeeds (check the rasql).

comment:3 by Alex Dumitru, 9 years ago

You need to select something 3D so that you can get the whole CRS including the crs with the " character.

comment:4 by Bang Pham Huu, 9 years ago

Ok, I got the idea, thanks. But I could not use WCST_Import to insert a test coverage with the time axis and label as Vlad's suggestion.

"options": {           
	      "time_start": "1950-01-01T00:00:00",
	      "time_format": "auto",
	      "time_crs": 
                "http://localhost:8080/def/crs/OGC/0/AnsiDate?axis-label=\"time\"",
	      "time_step": "1 seconds",
	      "tiling": "ALIGNED [0:1, 0:1, 0:2]" 
        }

It will returns error from WCST_Import.

RUNTIME ERROR: Unsupported time CRS AnsiDate?axis-label="time"

Then, I change to

 "time_crs": "http://localhost:8080/def/crs/OGC/0/AnsiDate?axis-label='d'"

it still return error

RUNTIME ERROR: Unsupported time CRS AnsiDate?axis-label='d'

So, how is the correct way to using axis-label in recipe? thanks.

comment:5 by Bang Pham Huu, 9 years ago

Ok, answer by myself (after Vlad also tried to help). The problem when I cannot use axis-label="time" when use wcst_import is

in time_util.py, it check like this

        if self.CRS_CODE_ANSI_DATE == self.time_crs_code:
            return self.to_ansi()
        elif self.CRS_CODE_UNIX_TIME == self.time_crs_code:
            return self.to_unix()
        else:
            return self.to_unknown()

then of course if in recipe use not only "AnsiDate" but also "AnsiDate?axis-label=\"time\"", it will return to self.to_unknown() and throw exception "Unsupported time CRS AnsiDate?axis-label="time"". Then now, I can check the behaviour as Alex requested.

comment:6 by Bang Pham Huu, 9 years ago

Summary: Petascope cannot encode coverages that have a CRS containing a ' " ' characterPetascope cannot encode coverages that have a CRS containing a ' " ' character (WCST_Import also).

comment:7 by Bang Pham Huu, 9 years ago

Description: modified (diff)

comment:8 by Bang Pham Huu, 9 years ago

Resolution: fixed
Status: newclosed

close as patch was accepted, thanks.

Note: See TracTickets for help on using tickets.