Changeset: f65e8f6349db for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f65e8f6349db
Modified Files:
        geom/monetdb5/gpu.c
Branch: sfcgal
Log Message:

gcontains should use floats. Only call the GPU code if there are points and a 
polygon


diffs (46 lines):

diff --git a/geom/monetdb5/gpu.c b/geom/monetdb5/gpu.c
--- a/geom/monetdb5/gpu.c
+++ b/geom/monetdb5/gpu.c
@@ -14,10 +14,10 @@
 #include "gpu.h"
 #define GEOMBULK_DEBUG
 static str
-GpnpolyWithHoles(bat *out, int nvert, dbl *vx, dbl *vy, int nholes, dbl **hx, 
dbl **hy, int *hn, bat *point_x, bat *point_y)
+GpnpolyWithHoles(bat *out, int nvert, flt *vx, flt *vy, int nholes, flt **hx, 
flt **hy, int *hn, bat *point_x, bat *point_y)
 {
        BAT *bo = NULL, *bpx = NULL, *bpy;
-       dbl *px = NULL, *py = NULL;
+       flt *px = NULL, *py = NULL;
        BUN i = 0, cnt = 0;
        bit *cs = NULL;
        char **mc = NULL;
@@ -53,8 +53,8 @@ GpnpolyWithHoles(bat *out, int nvert, db
        }
 
        /*Iterate over the Point BATs and determine if they are in Polygon 
represented by vertex BATs */
-       px = (dbl *) Tloc(bpx, 0);
-       py = (dbl *) Tloc(bpy, 0);
+       px = (flt *) Tloc(bpx, 0);
+       py = (flt *) Tloc(bpy, 0);
        cnt = BATcount(bpx);
        cs = (bit *) Tloc(bo, 0);
 #ifdef GEOMBULK_DEBUG
@@ -62,7 +62,8 @@ GpnpolyWithHoles(bat *out, int nvert, db
 #endif
 
        /*Call to the GPU function*/
-       pnpoly_GPU(&cs, nvert, cnt, px, py, vx, vy);
+       if (nvert && cnt)
+               pnpoly_GPU(&cs, nvert, cnt, px, py, vx, vy);
 
        /*
         * Verify if GPU has enough memory to get all the data 
@@ -89,7 +90,7 @@ GpnpolyWithHoles(bat *out, int nvert, db
 }
 
 str
-geom_gpu_gcontains(bit *res, wkb **a, double *x, double *y, double *z, int 
*srid)
+geom_gpu_gcontains(bit *res, wkb **a, float *x, float *y, float *z, int *srid)
 {
     vertexWKB *verts = NULL;
        wkb *geom = NULL;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to