Opened 6 years ago

Closed 6 years ago

#1866 closed defect (fixed)

WCPS request should enforce encode()

Reported by: Peter Baumann Owned by: Bang Pham Huu
Priority: major Milestone: 9.7
Component: petascope Version: development
Keywords: Cc: Vlad Merticariu, Dimitar Misev
Complexity: Medium

Description

A user reports that the following query:

for c in (Sentinel2)
	  return
	      coverage ndvi
	        over
             $px N(0:*),
             $py E(0:*),
             $pt ansi(0:*) 
	       values 
           (float)
           ((c[E($px),N($py),ansi($pt)].B08 -  c[E($px),N($py),ansi($pt)].B02) /
           (c[E($px),N($py),ansi($pt)].B08 +  c[E($px),N($py),ansi($pt)].B02))

returns this error message: "Invalid format number in interval (0,0)".

Actually missing is the encode() call in the first place.

The parser should return a syntax error, as per WCPS standard, in such a case. And a test case should be added to systemtest.

Change History (6)

comment:1 by Bang Pham Huu, 6 years ago

@Peter: what about:

for c in (lena) return c

it is still a valid query without any error.

comment:2 by Dimitar Misev, 6 years ago

Relevant standard clause:

7.1.2 processingExpr
The processingExpr element is either a encodedCoverageExpr (which evaluates to an encoded coverage; see Subclause 7.1.4), or a storeCoverageExpr (see Subclause 7.1.3), or a scalarExpr (which evaluates to coverage description data or coverage summary data; see Subclause 7.1.5).

comment:3 by Dimitar Misev, 6 years ago

it is still a valid query without any error.

not according to the standard it seems.

in reply to:  3 comment:4 by Bang Pham Huu, 6 years ago

Replying to dmisev:

it is still a valid query without any error.

not according to the standard it seems.

or this one? why even it needs encode()?

for c in (lena) return avg(c)

comment:5 by Dimitar Misev, 6 years ago

Did you read comment:2?

comment:6 by Bang Pham Huu, 6 years ago

Complexity: EasyMedium
Milestone: 9.7
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.