Update of /cvsroot/monetdb/geom/src/monetdb4
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7891/src/monetdb4
Modified Files:
geom.mx
Log Message:
- make a non-typed wkb creation function with better error handling than
the wkb() atomic creation function which crashes Monet in case of failure
U geom.mx
Index: geom.mx
===================================================================
RCS file: /cvsroot/monetdb/geom/src/monetdb4/geom.mx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- geom.mx 15 Dec 2008 14:11:51 -0000 1.14
+++ geom.mx 19 Dec 2008 08:49:16 -0000 1.15
@@ -51,6 +51,10 @@
.COMMAND wkb_from_text(str wkt, int tpe) : wkb = wkbFromText;
"Try to creates the a wkb of type, tpe, from the given wkt."
+ .COMMAND geo_wkb_from_text(str wkt) : wkb = geo_wkbFromText;
+ "Pathfinder:geoxml:JF:creates the a wkb of type, tpe, from the given wkt."
+
+
.COMMAND mbr(flt,flt,flt,flt) : mbr = ordinatesMBR;
"Creates the mbr for the given (xmin,ymin) and (xmax,ymax)."
@@ -488,6 +492,21 @@
return GDK_FAIL;
}
+int
+geo_wkbFromText(wkb **w, str wkt)
+{
+ int len = 0;
+
+ *w = NULL;
+ if ( wkbFROMSTR(wkt, &len, w) )
+ return GDK_SUCCEED;
+ if (!(*w))
+ *w = (wkb*)GDKmalloc(sizeof(wkb));
+ **w = *wkbNULL();
+ GDKerror("creating wkb: %s.\n",wkt);
+ return GDK_FAIL;
+}
+
BUN
wkbHASH(wkb *w)
{
------------------------------------------------------------------------------
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins