Opened 4 years ago

Closed 4 years ago

#407 closed defect (fixed)

WCPS parsing error with scalar * coverage expression

Reported by: mase Owned by: arezaeim
Priority: major Milestone: 9.0
Component: petascope Version: 8.4
Keywords: Cc: pbaumann, pcampalani
Complexity: Medium

Description

If I post the WCPS expression below to petascope I get the image expected back:

for v1 in (NIR) return encode (
(char) scale ((v1.red > 150) * 250 , { x:"CRS:1"(0:99), y:"CRS:1"(0:99) }, {}) , "png")

However, if I make the seemingly innocuous change swapping the order of the multiplied elements as below:

for v1 in (NIR) return encode (
(char) scale ( 250 * (v1.red > 150), { x:"CRS:1"(0:99), y:"CRS:1"(0:99) }, {}) , "png")

I get the error response:

<ows:ExceptionReport version="2.0.0" xsd:schemaLocation="http://www.opengis.net/ows/2.0 http://schemas.opengis.net/ows/2.0/owsExceptionReport.xsd"><ows:Exception exceptionCode="InternalComponentError"><ows:ExceptionText>Invalid coverage Expression, next node: cast - failed to match SubsetOperation: cast</ows:ExceptionText></ows:Exception></ows:ExceptionReport>

The Tomcat log is attached.

Attachments (1)

buglog.txt (29.0 KB) - added by mase 4 years ago.
Tomcat log

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by mase

Tomcat log

comment:1 Changed 4 years ago by dmisev

  • Cc pbaumann pcampalani added
  • Component changed from undecided to petascope
  • Owner changed from dmisev to arezaeim
  • Status changed from new to assigned

I think Alireza was already working on a ticket for the same bug.

comment:2 Changed 4 years ago by arezaeim

It seems the problem has been resolved in petascope 9, I added test 96 to wcps_tests to examine this:

for c in ( rgb ) return encode(255 * (c.red > 150) + (c.red > 150)*255 , "png" )

comment:3 follow-up: Changed 4 years ago by dmisev

Alireza can you add the test in the ticket, should be like this for rgb:

for v1 in (rgb) return encode (
(char) scale ( 250 * (v1.red > 150),
               { x:"CRS:1"(0:99), y:"CRS:1"(0:99) },
               {} )
, "png")

comment:4 in reply to: ↑ 3 Changed 4 years ago by pcampalani

Should be:

---      { x:"CRS:1"(0:99), y:"CRS:1"(0:99) },
+++      { i:"CRS:1"(0:99), j:"CRS:1"(0:99) },

btw, looking at the queries in the description, I think the issue is on the ScalarExpr * BooleanExpr which is not commutative. The ScaleExpr is noise in this case. Isn't it?

comment:5 Changed 4 years ago by arezaeim

This query also pass (axis labels should be i and j):

for v1 in (rgb) return encode (
(char) scale ( 250 * (v1.red > 150), { i:"CRS:1"(0:99), j:"CRS:1"(0:99) }, {}) , "png")

The reason for creating the test as such is that if you look in the ticket description the two queries only differs in the way the multiplication operands are used.

comment:6 Changed 4 years ago by dmisev

Ok if that test passes too (comment:4) I think we can close this ticket?

comment:7 Changed 4 years ago by arezaeim

Shall we add it as new test?

comment:8 Changed 4 years ago by pcampalani

I guess we should test in on rasdaman 8.5 release and either close it or fix it.

comment:9 Changed 4 years ago by dmisev

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