Changeset: 32c832909c16 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=32c832909c16
Modified Files:
        sql/backends/monet5/UDF/ssdb.c
Branch: ssdb
Log Message:

more fix.  cooking works, with a extreme lazy implementation of polygoniser


diffs (50 lines):

diff --git a/sql/backends/monet5/UDF/ssdb.c b/sql/backends/monet5/UDF/ssdb.c
--- a/sql/backends/monet5/UDF/ssdb.c
+++ b/sql/backends/monet5/UDF/ssdb.c
@@ -121,6 +121,7 @@ compute_polygon(mvc *sql, BUN nr_pixs, B
                        tout_plg_ord_t[idx] = ord;
                        tout_plg_x_t[idx] = obs_pix[i].x[ord];
                        tout_plg_y_t[idx] = obs_pix[i].y[ord];
+                       idx++;
                }
        }
 
@@ -514,12 +515,10 @@ SSDBcooking(Client cntxt, MalBlkPtr mb, 
        /* Second pass over all input pixels, to aggregate the values for
         * the observations */
        for (idx = 0; idx < nr_pixs; idx++) {
-               obs_pixels pixs;
+               obs_pixels *pixs = &obs_pix[obsid[idx]];
+               cur_obsid = obsid[idx];
 
-               cur_obsid = obsid[idx];
-               pixs = obs_pix[cur_obsid];
-
-               if (cur_obsid > last_obsid) {
+               if (idx == 0 || cur_obsid > last_obsid) {
                        last_obsid = cur_obsid;
                        /* init values for a new obs */
                        tout_obs_obsid_t[cur_obsid] = cur_obsid;
@@ -546,16 +545,16 @@ SSDBcooking(Client cntxt, MalBlkPtr mb, 
                }
 
                /* gather all pixels of this observation for computing its 
polygon */
-               if (pixs.cnt == pixs.cap) {
-                       if (!_obs_pix_expand(&pixs)) {
+               if (pixs->cnt == pixs->cap) {
+                       if (!_obs_pix_expand(pixs)) {
                                msg = sql_message("COOKING(): GDKrealloc 
'obs_pix[" BUNFMT "].x' failed", idx);
                                goto CLEANUP_RETURN;
                        }
                }
-               pixs.obsid = cur_obsid;
-               pixs.x[pixs.cnt] = tin_x_t[idx];
-               pixs.y[pixs.cnt] = tin_y_t[idx];
-               pixs.cnt++;
+               pixs->obsid = cur_obsid;
+               pixs->x[pixs->cnt] = tin_x_t[idx];
+               pixs->y[pixs->cnt] = tin_y_t[idx];
+               pixs->cnt++;
        }
        /* First pass over all observations to compute the center{X,Y} */
        for (cur_obsid = 0; cur_obsid < nr_obs; cur_obsid++) {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to