Opened 7 months ago

Closed 4 months ago

#1436 closed defect (fixed)

WCPS_Supports user defined band names in range constructor

Reported by: bphamhuu Owned by: bphamhuu
Priority: major Milestone: 9.4
Component: petascope Version: development
Keywords: Cc: dmisev, vmerticariu
Complexity: Medium

Description (last modified by dmisev)

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 Changed 7 months ago by dmisev

  • Description modified (diff)

comment:2 Changed 7 months ago by bphamhuu

Note: comment moved to ticket #1437

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\"}
Last edited 7 months ago by dmisev (previous) (diff)

comment:3 Changed 4 months ago by bphamhuu

  • Milestone changed from 9.3 to 9.4

comment:4 Changed 4 months ago by bphamhuu

  • Owner set to bphamhuu
  • Status changed from new to assigned

comment:5 Changed 4 months ago by bphamhuu

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