Changeset: fbbb3d714f4b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fbbb3d714f4b
Modified Files:
        geom/monetdb5/geom.c
        geom/monetdb5/geom.h
        geom/monetdb5/geom.mal
        geom/sql/40_geom.sql
Branch: sfcgal
Log Message:

Fix bug when creating Polygon. Add templates for Pach_to_Geom


diffs (69 lines):

diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -3225,7 +3225,7 @@ wkbMakePolygon(wkb **out, wkb **external
        linearRingGeometry = GEOSGeom_createLinearRing(coordSeq_copy);
 
        //create a polygon using the linearRing
-       if (internalBAT_id == NULL && *internalBAT_id == 0) {
+       if (internalBAT_id != NULL && *internalBAT_id == bat_nil) {
                geosGeometry = GEOSGeom_createPolygon(linearRingGeometry, NULL, 
0);
                if (geosGeometry == NULL) {
                        *out = NULL;
@@ -6473,3 +6473,22 @@ wkbAsGeoJson(str *res, wkb **geomWBK, in
        return MAL_SUCCEED;
 }
 
+str
+wkbPatchToGeom(wkb **res, wkb **geom, dbl* px, dbl*py, dbl*pz) {
+    (void) res;
+    (void) geom;
+    (void) px;
+    (void) py;
+    (void) pz;
+       return MAL_SUCCEED;
+}
+
+str
+wkbPatchToGeom_bat(wkb **res, wkb **geom, bat* px, bat* py, bat* pz) {
+    (void) res;
+    (void) geom;
+    (void) px;
+    (void) py;
+    (void) pz;
+       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
@@ -326,3 +326,5 @@ geom_export char *geom_to_geojson(GEOSGe
 geom_export char *geom_to_x3d_3(GEOSGeom geom, int precision, int opts, const 
char *defid);
 geom_export str wkbAsX3D(str *res, wkb **geom, int *maxDecDigits, int 
*options);
 geom_export str wkbAsGeoJson(str *res, wkb **geom, int *maxDecDigits, int 
*options);
+geom_export str wkbPatchToGeom(wkb **res, wkb **geom, dbl* px, dbl*py, dbl*pz);
+geom_export str wkbPatchToGeom_bat(wkb **res, wkb **geom, bat* px, bat* py, 
bat* pz);
diff --git a/geom/monetdb5/geom.mal b/geom/monetdb5/geom.mal
--- a/geom/monetdb5/geom.mal
+++ b/geom/monetdb5/geom.mal
@@ -804,3 +804,13 @@ comment "Returns a Geometry in X3D xml n
 
 command asGeoJson(geom:wkb, maxDecDigits:int, options:int) :str address 
wkbAsGeoJson
 comment "Return the geometry as a GeoJSON element.";
+
+#Miscellaneous functions
+command PatchToGeom(geom:wkb, x:dbl, y:dbl, z:dbl) :wkb
+address wkbPachToGeom
+comment "Return the geometry with the z values rounded to the closest value at 
the vertexes.";
+
+command PatchToGeom(geom:wkb, x:bat[:oid,:dbl], y:bat[:oid,:dbl], 
z:bat[:oid,:dbl]) :wkb
+address wkbPachToGeom_bat
+comment "Return the geometry with the z values rounded to the closest value at 
the vertexes.";
+
diff --git a/geom/sql/40_geom.sql b/geom/sql/40_geom.sql
--- a/geom/sql/40_geom.sql
+++ b/geom/sql/40_geom.sql
@@ -4459,3 +4459,4 @@ CREATE FUNCTION ST_SimplifyPreserveTopol
 CREATE FUNCTION Contains(a Geometry, x double, y double) RETURNS BOOLEAN 
external name geom."Contains";
 CREATE FUNCTION ST_AsX3D(a Geometry, maxDecDigits int, options int) returns 
string external name geom."asX3D";
 CREATE FUNCTION ST_AsGeoJson(a Geometry, maxDecDigits int, options int) 
returns string external name geom."asGeoJson";
+CREATE FUNCTION Patch_to_Geom(a Geometry, x double, y double, z double) 
RETURNS Geometry external name geom."PatchToGeom';
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to