Opened 5 years ago

Closed 5 years ago

#2154 closed defect (fixed)

rasql - wrong struct type for band subsetting import by gdal driver

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

Description (last modified by Bang Pham Huu)

This ticket is needed for #2130

Run these rasql commands to reproduce with importing only 1 the first band from 3 bands RGB file:

rasql -q 'CREATE TYPE test_wcs_gdal_select_1band_from_3bands_to_import1_Array AS char MDARRAY [D0,D1]' --user rasadmin --passwd rasadmin
rasql -q 'CREATE TYPE test_wcs_gdal_select_1band_from_3bands_to_import1_Set AS SET (test_wcs_gdal_select_1band_from_3bands_to_import1_Array NULL VALUES [119.0])' --user rasadmin --passwd rasadmin
rasql -q 'CREATE COLLECTION test_wcs_gdal_select_1band_from_3bands_to_import1 test_wcs_gdal_select_1band_from_3bands_to_import1_Set' --user rasadmin --passwd rasadmin

rasql -q 'INSERT INTO test_wcs_gdal_select_1band_from_3bands_to_import1 VALUES <[0:0,0:0] 119c> TILING ALIGNED [0:1023, 0:1023] TILE SIZE 4194304' --user rasadmin --passwd rasadmin
rasql -q 'UPDATE test_wcs_gdal_select_1band_from_3bands_to_import1 SET test_wcs_gdal_select_1band_from_3bands_to_import1[0:399,0:343] ASSIGN decode(<[0:0] 1c>, "GDAL", "{\"variables\":[0],\"filePaths\":[\"YOUR_RASDAMAN_SOURCE_PATH/systemtest/testcases_services/test_all_wcst_import/testdata/wcps_rgb/rgb.png\"]}")'

Then, it has this error

2019-08-05 14:37:41,147, qlparser/qtupdate.cc:192: Base type of source object (struct { char , char  }) 
does not match the base type of the target object (char)

It also needs to support importing 3 bands from a 3 bands RGB image but in a different order (e.g: BGR)

rasql -q 'CREATE COLLECTION test_rgb2 test_rgb_2019_08_05_14_45_00_1872_Set' --user rasadmin --passwd rasadmin
rasql -q 'INSERT INTO test_rgb2 VALUES <[0:0,0:0] {119c,208c,248c}> TILING ALIGNED [0:1023, 0:1023] TILE SIZE 4194304' --user rasadmin --passwd rasadmin
rasql -q 'UPDATE test_rgb2 SET test_rgb2[0:399,0:343] ASSIGN decode(<[0:0] 1c>, "GDAL", "{\"variables\":[2,1,0], \"filePaths\":[\"YOUR_PATH_TO_RASDAMAN_SOURCE/systemtest/testcases_services/test_all_wcst_import/testdata/wcps_rgb/rgb.png\"]}")' --user rasadmin --passwd rasadmin

Current error is:

qlparser/qtupdate.cc:192: Base type of source object (struct { char , char , char , char , char , char  }) does not match the base type of the target object (struct { char band0, char band1, char band2 })
rasdaman error 434: Execution error: Cell base types of binary induce operation are incompatible.

Change History (3)

comment:1 by Dimitar Misev, 5 years ago

Owner: changed from Dimitar Misev to dkamov
Status: newassigned

comment:2 by Bang Pham Huu, 5 years ago

Description: modified (diff)

comment:3 by dkamov, 5 years ago

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