Changeset: c778bf1f516f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c778bf1f516f Modified Files: gdk/gdk_tracer.h geom/lib/libgeom.c geom/monetdb5/geom.c geom/monetdb5/geom.h Branch: tracer Log Message:
Added GDKtracer to geom diffs (105 lines): diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h --- a/gdk/gdk_tracer.h +++ b/gdk/gdk_tracer.h @@ -27,6 +27,7 @@ typedef enum { // ALL M_ALL, ALLOC, + GEOM, // SQL SQL_ALL, diff --git a/geom/lib/libgeom.c b/geom/lib/libgeom.c --- a/geom/lib/libgeom.c +++ b/geom/lib/libgeom.c @@ -15,6 +15,7 @@ #include "monetdb_config.h" #include "libgeom.h" +#include "gdk_tracer.h" #include <math.h> @@ -193,18 +194,14 @@ geom_type2str(int t, int flag) str geomerty_2_geometry(wkb *res, wkb **geom, int *columnType, int *columnSRID, int *valueSRID) { - //char* geomStr; //size_t len = 0; - //fprintf(stderr, "geometry_2_geometry\n"); + DEBUG(GEOM, "Enter geometry_2_geometry\n"); //wkbTOSTR(&geomStr, &len, *geom); if (*geom != NULL) - fprintf(stderr, "type:%d - wkbTOSTR cannot be seen at this point\n", *columnType); + DEBUG(GEOM, "Type: %d - wkbTOSTR cannot be seen at this point\n", *columnType); - if (res == NULL) - fprintf(stderr, "-> "); - - fprintf(stderr, "%d vs %d\n", *columnSRID, *valueSRID); + DEBUG(GEOM, "%s %d vs %d\n", res == NULL ? "->" : "", *columnSRID, *valueSRID); return "0"; } */ diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -904,7 +904,9 @@ segmentizeLineString(GEOSGeometry **outG //compute the distance of the current point to the last added one while ((dist = sqrt(pow(xl - xCoords_org[i], 2) + pow(yl - yCoords_org[i], 2) + pow(zl - zCoords_org[i], 2))) > sz) { -//fprintf(stderr, "OLD : (%f, %f, %f) vs (%f, %f, %f) = %f\n", xl, yl, zl, xCoords_org[i], yCoords_org[i], zCoords_org[i], dist); +#ifdef DEBUG_GEOM + DEBUG(GEOM, "Old : (%f, %f, %f) vs (%f, %f, %f) = %f\n", xl, yl, zl, xCoords_org[i], yCoords_org[i], zCoords_org[i], dist); +#endif additionalPoints++; //compute the point xl = xl + (xCoords_org[i] - xl) * sz / dist; @@ -917,7 +919,9 @@ segmentizeLineString(GEOSGeometry **outG zl = zCoords_org[i]; } -//fprintf(stderr, "Adding %u\n", additionalPoints); + + DEBUG(GEOM, "Adding %u\n", additionalPoints); + //create the coordinates sequence for the translated geometry if ((gcs_new = GEOSCoordSeq_create(pointsNum + additionalPoints, coordinatesNum)) == NULL) { *outGeometry = NULL; @@ -950,7 +954,10 @@ segmentizeLineString(GEOSGeometry **outG //compute the distance of the current point to the last added one double dist; while ((dist = sqrt(pow(xl - xCoords_org[i], 2) + pow(yl - yCoords_org[i], 2) + pow(zl - zCoords_org[i], 2))) > sz) { -//fprintf(stderr, "OLD : (%f, %f, %f) vs (%f, %f, %f) = %f\n", xl, yl, zl, xCoords_org[i], yCoords_org[i], zCoords_org[i], dist); + +#ifdef DEBUG_GEOM + DEBUG(GEOM, "Old: (%f, %f, %f) vs (%f, %f, %f) = %f\n", xl, yl, zl, xCoords_org[i], yCoords_org[i], zCoords_org[i], dist); +#endif assert(j < additionalPoints); //compute intermediate point @@ -2390,7 +2397,11 @@ wkbAsBinary(char **toStr, wkb **geomWKB) *s++ = hexit[val]; val = (*geomWKB)->data[i] & 0xf; *s++ = hexit[val]; -//fprintf(stderr, "%d First: %c - Second: %c ==> Original %c (%d)\n", i, *(s-2), *(s-1), (*geomWKB)->data[i], (int)((*geomWKB)->data[i])); + + #ifdef DEBUG_GEOM + DEBUG(GEOM, "%d: First: %c - Second: %c ==> Original %c (%d)\n", i, *(s-2), *(s-1), (*geomWKB)->data[i], (int)((*geomWKB)->data[i])); + #endif + } *s = '\0'; return MAL_SUCCEED; diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h --- a/geom/monetdb5/geom.h +++ b/geom/monetdb5/geom.h @@ -35,6 +35,7 @@ #define geom_export extern #endif +/* #define DEBUG_GEOM */ /* general functions */ geom_export str geoHasZ(int* res, int* info); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list