#219 closed defect (fixed)
WCPS overlay operator works wrong way round
Reported by: | 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 , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 12 years ago
http://www.maps.google.com/ - http://www.wikipedia.org/ - wiki
<a href=http://mail.ru/>mail</a>
I submitted a fix.