#1260 closed defect (fixed)

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

Reported by: mdumitru Owned by: vmerticariu
Priority: major Milestone: 10.0
Component: petascope Version: development
Keywords: Cc: bphamhuu
Complexity: Medium

Description (last modified by bphamhuu)

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 Changed 16 months ago by bphamhuu

@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 Changed 16 months ago by vmerticariu

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 Changed 16 months ago by mdumitru

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

comment:4 Changed 16 months ago by bphamhuu

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 Changed 14 months ago by bphamhuu

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 Changed 14 months ago by bphamhuu

  • Summary changed from Petascope cannot encode coverages that have a CRS containing a ' " ' character to Petascope cannot encode coverages that have a CRS containing a ' " ' character (WCST_Import also).

comment:7 Changed 14 months ago by bphamhuu

  • Description modified (diff)

comment:8 Changed 13 months ago by bphamhuu

  • Resolution set to fixed
  • Status changed from new to closed

close as patch was accepted, thanks.

Note: See TracTickets for help on using tickets.