Opened 8 years ago

Closed 8 years ago

#1436 closed defect (fixed)

WCPS_Supports user defined band names in range constructor

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

Description (last modified by Dimitar Misev)

current WCPS checks band names strictly (i.e: if in range constructor has a non-existing band, it will throw exception). This is necesary as in netCDF, it can write in coverage metadata user defined band names and should be supported.

WCPS query example:

for c in ( test_rgb ) return encode(
 { blueTEST: c.red; redTEST: c.blue }.redTEST
, "netcdf")

the output should have redTEST as band name in netCDF.

\"redTEST\":{
   \"type\":\"unsigned char\",\"metadata\":{\"units\":\"10^0\"},\"name\":\"redTEST\"}

Furthermore, a range constructor with a single field should only translate the field expression to rasql, and not to a whole range constructor. E.g.

single field

WCPS:
for c in (test_rgb) return {blue: c.red}
rasql:
select c.red from test_rgb as c

multi field

WCPS:
for c in (test_rgb) return {blue: c.red; red: c.blue}
rasql:
select {c.red, c.blue} from test_rgb as c

Change History (5)

comment:1 by Dimitar Misev, 8 years ago

Description: modified (diff)

comment:2 by Bang Pham Huu, 8 years ago

There is a problem with choosing the metadata of the range, e.g:

 {redTEST: ( (c.red + c.blue + c.green) / 3 ) * (c.green);}

it will need to get some metadata for redTEST (e.g: data type, metadata, units,…) not only the name. To do this, it need to consider from the above expression, which band name will be chosen to assign to redTEST (c.red or c.blue or c.green) ?

as c.red can have different metadata (e.g: c.red: unit: 10, data type: float, nilValues: 100)

c.blue: unit: 10, data type: float, nilValues: 200)
c.green: unit: 10, data type: float, nilValues: 300)

current I think WCPS will take it from c.red as it is from leftmost one and it will be propagated from left to right (but still need to confirm!).

then it will write in netCDF as

\"redTEST\":{
   \"type\":\"unsigned char\",\"metadata\":{\"units\":\"10\",
                                            \"nilValue\": 300},
                                             \"name\":\"redTEST\"}
Version 0, edited 8 years ago by Bang Pham Huu (next)

comment:3 by Bang Pham Huu, 8 years ago

Milestone: 9.39.4

comment:4 by Bang Pham Huu, 8 years ago

Owner: set to Bang Pham Huu
Status: newassigned

comment:5 by Bang Pham Huu, 8 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.