Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#219 closed defect (fixed)

WCPS overlay operator works wrong way round

Reported by: mase@… Owned by: Alireza
Priority: major Milestone: 8.4
Component: petascope Version: 8.3
Keywords: Cc:
Complexity: Medium

Description

I was having trouble getting the overlay operator in WCPS to work until I realised that it is defined the opposite way round in WCPS and rasdaman.

In the WCPS standard section 7.1.21 binaryInducedExpr there is a definition of the overlay operator such that:

For C1 overlay C2 the result should be

value(C2,p) if value(C1,p) = 0 or value (C1,p) otherwise.

If I execute a WCPS query like the following in Petascope:

for c in (bgs_rs) return
encode(

(coverage const2
over $px x(0:2)
value list <0;1;1>)
overlay
(coverage const
over $px x(0:2)
value list <2;2;0>)

, "csv")

it is converted to the rasql query

select csv(((< [0:2] 0, 1, 1>)overlay(< [0:2] 2, 2, 0>))) from bgs_rs AS c

which gives the result

{2,2,1}

According to the WCPS definition the result should be {2,1,1}.

The definition of "a overlay b" in the rasql guide is "(b != 0) * b + (b == 0) * a" so rasql is giving the result expected from the generated rasql query.

I posted a message on the rasdaman-users list and Peter Baumann replied on 9th Sept that the sense of overlay in WCPS and rasql are indeed the opposite way round. Therefore Petascope needs fixing to swap the order when converting a WCPS overlay query to rasql.

Change History (3)

comment:1 by Dimitar Misev, 12 years ago

Owner: changed from Dimitar Misev to Alireza
Status: newassigned

comment:2 by Dimitar Misev, 12 years ago

Resolution: fixed
Status: assignedclosed

I submitted a fix.

Note: See TracTickets for help on using tickets.