Opened 2 years ago

Closed 2 years ago

#863 closed defect (fixed)

decode doesn't import ushort tiff properly

Reported by: dmisev Owned by: gmerticariu
Priority: major Milestone: 9.1
Component: qlparser Version: development
Keywords: Cc: vmerticariu
Complexity: Medium

Description

Create an unsigned short array and export it (all cells = 2):

$ rasql -q 'create collection a UShortSet'
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
Executing update query...ok
rasql done.
$ rasql -q 'insert into a values 2us'
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
Executing insert query...rasdaman error 960: Update error 960 in line 1, column 1, near token insert: Insert expression must be of type MDD.
aborting transaction...ok
rasql done.
$ rasql -q 'insert into a values marray i in [0:9,0:9] values 2us'
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
Executing insert query...ok
rasql done.
$ rasql -q 'select encode(c, "GTiff") from a as c' --out file
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
Executing retrieval query...ok
Query result collection has 1 element(s):
  Result object 1: going into file rasql_1.tif...ok.
rasql done.

Import afterwards, decode fails to produce correct values:

$ rasql -q 'delete from a'
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
Executing update query...ok
rasql done.
$ rasql -q 'insert into a values inv_tiff($1)' -f rasql_1.tif
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
fetching type information for GreyString from database, using readonly transaction...ok
reading file rasql_1.tif...ok
  constant 1: GMarray
  Oid...................:
  Type Structure........:
  Type Schema...........: marray< char >
  Domain................: [0:441]
  Base Type Schema......: char
  Base Type Length......: 1
  Data format.......... : Array
  Data size (bytes).... : 442
Executing insert query...ok
rasql done.
$ rasql -q 'select csv(a) from a' --out string
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
Executing retrieval query...ok
Query result collection has 1 element(s):
  Result object 1: {2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2}
rasql done.
$ rasql -q 'delete from a'
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
Executing update query...ok
rasql done.
$ rasql -q 'insert into a values decode($1)' -f rasql_1.tif
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
fetching type information for GreyString from database, using readonly transaction...ok
reading file rasql_1.tif...ok
  constant 1: GMarray
  Oid...................:
  Type Structure........:
  Type Schema...........: marray< char >
  Domain................: [0:441]
  Base Type Schema......: char
  Base Type Length......: 1
  Data format.......... : Array
  Data size (bytes).... : 442
Executing insert query...ok
rasql done.
$ rasql -q 'select csv(a) from a' --out string
rasql: rasdaman query tool v1.0, rasdaman v9.0.5-ge29fb75 -- generated on 11.12.2014 16:01:14.
opening database RASBASE at localhost:7001...ok
Executing retrieval query...ok
Query result collection has 1 element(s):
  Result object 1: {2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,2,2},{0,0,33,0,0,0,97,0,0,0},{97,0,0,0,38280,443,0,0,33,0},{0,0,26691,29281,0,0,1,0,15,0},{43208,443,0,0,33,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}
rasql done.

Change History (1)

comment:1 Changed 2 years ago by gmerticariu

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