Opened 7 years ago

Closed 6 years ago

#1474 closed defect (fixed)

WCPS_Cannot encode multiple ranges in netcdf

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

Description (last modified by Dimitar Misev)

It seems WCPS encode range does not work.

WCPS:

for c in (test_world_temp)return encode({red:   c.0; green: c.2}, "netcdf")

Rasql:

SELECT encode({c.0,c.2}, "netCDF" , "{\"dimensions\":[\"Long\",\"Lat\"],\"variables\":{\"Long\":{\"type\":\"double\",\"data\":[-179.0,-177.0,-175.0,-173.0,-171.0,-169.0,-167.0,-165.0,-163.0,-161.0,-159.0,-157.0,-155.0,-153.0,-151.0,-149.0,-147.0,-145.0,-143.0,-141.0,-139.0,-137.0,-135.0,-133.0,-131.0,-129.0,-127.0,-125.0,-123.0,-121.0,-119.0,-117.0,-115.0,-113.0,-111.0,-109.0,-107.0,-105.0,-103.0,-101.0,-99.0,-97.0,-95.0,-93.0,-91.0,-89.0,-87.0,-85.0,-83.0,-81.0,-79.0,-77.0,-75.0,-73.0,-71.0,-69.0,-67.0,-65.0,-63.0,-61.0,-59.0,-57.0,-55.0,-53.0,-51.0,-49.0,-47.0,-45.0,-43.0,-41.0,-39.0,-37.0,-35.0,-33.0,-31.0,-29.0,-27.0,-25.0,-23.0,-21.0,-19.0,-17.0,-15.0,-13.0,-11.0,-9.0,-7.0,-5.0,-3.0,-1.0,1.0,3.0,5.0,7.0,9.0,11.0,13.0,15.0,17.0,19.0,21.0,23.0,25.0,27.0,29.0,31.0,33.0,35.0,37.0,39.0,41.0,43.0,45.0,47.0,49.0,51.0,53.0,55.0,57.0,59.0,61.0,63.0,65.0,67.0,69.0,71.0,73.0,75.0,77.0,79.0,81.0,83.0,85.0,87.0,89.0,91.0,93.0,95.0,97.0,99.0,101.0,103.0,105.0,107.0,109.0,111.0,113.0,115.0,117.0,119.0,121.0,123.0,125.0,127.0,129.0,131.0,133.0,135.0,137.0,139.0,141.0,143.0,145.0,147.0,149.0,151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,177.0,179.0],\"name\":\"Long\",\"metadata\":{\"standard_name\":\"longitude\",\"units\":\"degree_east\",\"axis\":\"X\"}},\"Lat\":{\"type\":\"double\",\"data\":[89.0,87.0,85.0,83.0,81.0,79.0,77.0,75.0,73.0,71.0,69.0,67.0,65.0,63.0,61.0,59.0,57.0,55.0,53.0,51.0,49.0,47.0,45.0,43.0,41.0,39.0,37.0,35.0,33.0,31.0,29.0,27.0,25.0,23.0,21.0,19.0,17.0,15.0,13.0,11.0,9.0,7.0,5.0,3.0,1.0,-1.0,-3.0,-5.0,-7.0,-9.0,-11.0,-13.0,-15.0,-17.0,-19.0,-21.0,-23.0,-25.0,-27.0,-29.0,-31.0,-33.0,-35.0,-37.0,-39.0,-41.0,-43.0,-45.0,-47.0,-49.0,-51.0,-53.0,-55.0,-57.0,-59.0,-61.0,-63.0,-65.0,-67.0,-69.0,-71.0,-73.0,-75.0,-77.0,-79.0,-81.0,-83.0,-85.0,-87.0,-89.0],\"name\":\"Lat\",\"metadata\":{\"standard_name\":\"latitude\",\"units\":\"degree_north\",\"axis\":\"Y\"}},\"Blue\":{\"type\":\"unsigned char\",\"name\":\"Blue\",\"metadata\":{\"units\":\"10^0\"}}},\"geoReference\":{\"crs\":\"EPSG:4326\",\"bbox\":{\"xmin\":-180.0,\"ymin\":-90.0,\"xmax\":180.0,\"ymax\":90.0}}}") FROM test_world_temp AS c

log:

 [INFO] - 30/01/2017 11:23:30.327647: parsing...
 [INFO] - 30/01/2017 11:23:30.327775: checking semantics...
 [INFO] - 30/01/2017 11:23:30.327874: evaluating...
[FATAL] - 30/01/2017 11:23:30.328763, netcdf.cc:662: mismatch in #variables between query and MDD object type.
Error number: 381 Token: encode Line: 1 Column: 8

It works with 1 range though

for c in (test_world_temp)return encode({red:   c.0}, "netcdf") 

Change History (7)

comment:1 by Dimitar Misev, 7 years ago

Owner: set to bbell
Status: newassigned

The issue here is probably that source:qlparser/qtrangeconstructor.cc does not set the correct type in its checkType() method.

comment:2 by Bang Pham Huu, 6 years ago

Milestone: 9.49.6

comment:3 by Dimitar Misev, 6 years ago

Description: modified (diff)

comment:4 by Dimitar Misev, 6 years ago

Owner: changed from bbell to Bang Pham Huu

This looks like an issue in petascope, because in \"variables\" it only specifies one variable "Blue", but not "Red" (for c.0).

comment:5 by Dimitar Misev, 6 years ago

Description: modified (diff)
Summary: Rasql_Cannot encode multiple ranges in netcdfWCPS_Cannot encode multiple ranges in netcdf

comment:6 by Dimitar Misev, 6 years ago

Milestone: 9.69.7

comment:7 by Bang Pham Huu, 6 years ago

Resolution: fixed
Status: assignedclosed

Tested with the new Petascope and it was fixed with generated Rasql query for 2 bands (c.0 - Red and c.2 - Green).

SELECT encode({c.0,c.2}, "netcdf" , "{\"dimensions\":[\"Long\",\"Lat\"],\"variables\":{\"Long\":{\"type\":\"double\",\"data\":[-179.0,-177.0,-175.0,-173.0,-171.0,-169.0,-167.0,-165.0,-163.0,-161.0,-159.0,-157.0,-155.0,-153.0,-151.0,-149.0,-147.0,-145.0,-143.0,-141.0,-139.0,-137.0,-135.0,-133.0,-131.0,-129.0,-127.0,-125.0,-123.0,-121.0,-119.0,-117.0,-115.0,-113.0,-111.0,-109.0,-107.0,-105.0,-103.0,-101.0,-99.0,-97.0,-95.0,-93.0,-91.0,-89.0,-87.0,-85.0,-83.0,-81.0,-79.0,-77.0,-75.0,-73.0,-71.0,-69.0,-67.0,-65.0,-63.0,-61.0,-59.0,-57.0,-55.0,-53.0,-51.0,-49.0,-47.0,-45.0,-43.0,-41.0,-39.0,-37.0,-35.0,-33.0,-31.0,-29.0,-27.0,-25.0,-23.0,-21.0,-19.0,-17.0,-15.0,-13.0,-11.0,-9.0,-7.0,-5.0,-3.0,-1.0,1.0,3.0,5.0,7.0,9.0,11.0,13.0,15.0,17.0,19.0,21.0,23.0,25.0,27.0,29.0,31.0,33.0,35.0,37.0,39.0,41.0,43.0,45.0,47.0,49.0,51.0,53.0,55.0,57.0,59.0,61.0,63.0,65.0,67.0,69.0,71.0,73.0,75.0,77.0,79.0,81.0,83.0,85.0,87.0,89.0,91.0,93.0,95.0,97.0,99.0,101.0,103.0,105.0,107.0,109.0,111.0,113.0,115.0,117.0,119.0,121.0,123.0,125.0,127.0,129.0,131.0,133.0,135.0,137.0,139.0,141.0,143.0,145.0,147.0,149.0,151.0,153.0,155.0,157.0,159.0,161.0,163.0,165.0,167.0,169.0,171.0,173.0,175.0,177.0,179.0],\"name\":\"Long\",\"metadata\":{}},\"Lat\":{\"type\":\"double\",\"data\":[89.0,87.0,85.0,83.0,81.0,79.0,77.0,75.0,73.0,71.0,69.0,67.0,65.0,63.0,61.0,59.0,57.0,55.0,53.0,51.0,49.0,47.0,45.0,43.0,41.0,39.0,37.0,35.0,33.0,31.0,29.0,27.0,25.0,23.0,21.0,19.0,17.0,15.0,13.0,11.0,9.0,7.0,5.0,3.0,1.0,-1.0,-3.0,-5.0,-7.0,-9.0,-11.0,-13.0,-15.0,-17.0,-19.0,-21.0,-23.0,-25.0,-27.0,-29.0,-31.0,-33.0,-35.0,-37.0,-39.0,-41.0,-43.0,-45.0,-47.0,-49.0,-51.0,-53.0,-55.0,-57.0,-59.0,-61.0,-63.0,-65.0,-67.0,-69.0,-71.0,-73.0,-75.0,-77.0,-79.0,-81.0,-83.0,-85.0,-87.0,-89.0],\"name\":\"Lat\",\"metadata\":{}},

\"red\":{\"name\":\"red\",\"metadata\":{\"units\":\"10^0\"}},
\"green\":{\"name\":\"green\",\"metadata\":{\"units\":\"10^0\"}}},

\"geoReference\":{\"crs\":\"EPSG:4326\",\"bbox\":{\"xmin\":-180,\"ymin\":-90,\"xmax\":180,\"ymax\":90}}}") FROM test_world_temp AS c
Note: See TracTickets for help on using tickets.