Changeset: 2d5de43264d6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2d5de43264d6
Modified Files:
        sql/backends/monet5/vaults/gdal/gdal.c
Branch: SciQL-2
Log Message:

gdal-loader: create "valid" array in column-major order
just like the geotiff loader does


diffs (30 lines):

diff --git a/sql/backends/monet5/vaults/gdal/gdal.c 
b/sql/backends/monet5/vaults/gdal/gdal.c
--- a/sql/backends/monet5/vaults/gdal/gdal.c
+++ b/sql/backends/monet5/vaults/gdal/gdal.c
@@ -193,7 +193,7 @@ GDALloadGreyscaleImage(bat *x, bat *y, b
                for(i = 0; i < len; i++) {
                        if (GDALRasterIO(hBand, GF_Read, 0, i, wid, 1, linebuf, 
wid, 1, GDT_Byte, 0, 0) != CE_Failure) {
                                for (j = 0; j < wid; j++) 
-                                       data_sht[i*wid + j] = ((unsigned 
char*)linebuf)[j];
+                                       data_sht[j*len + i] = ((unsigned 
char*)linebuf)[j];
                        }
                }
                break;
@@ -218,7 +218,7 @@ GDALloadGreyscaleImage(bat *x, bat *y, b
        /* Manually compute values for the X-dimension, since we know that its
         * range is [0:1:wid] and each of its value must be repeated 'len'
         * times with 1 #repeats */
-       errbuf = ARRAYseries(&bidx, 0, 1, wid, 1, len);
+       errbuf = ARRAYseries(&bidx, 0, 1, wid, len, 1);
        if (errbuf != MAL_SUCCEED) {
                BBPdecref(bidi, 1); /* undo the BBPkeepref(resI->batCacheid) 
above */
                return createException(MAL, "gdal.loadimage", "Failed to create 
the X-dimension of %s", *fname);
@@ -226,7 +226,7 @@ GDALloadGreyscaleImage(bat *x, bat *y, b
        /* Manually compute values for the Y-dimension, since we know that its
         * range is [0:1:len] and each of its value must be repeated 1 times
         * with 'wid' #repeats */
-       errbuf = ARRAYseries(&bidy, 0, 1, len, wid, 1);
+       errbuf = ARRAYseries(&bidy, 0, 1, len, 1, wid);
        if (errbuf != MAL_SUCCEED) {
                BBPdecref(bidi, 1); /* undo the BBPkeepref(resI->batCacheid) 
above */
                BBPdecref(bidx, 1); /* undo the BBPkeepref(resX->batCacheid) by 
ARRAYseries_*() */
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to