Changeset: b133a881c85a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b133a881c85a
Modified Files:
geom/monetdb5/geom.mx
geom/sql/Tests/basic.stable.err
geom/sql/Tests/basic.stable.out
Branch: default
Log Message:
geom: GEOSgetSRID can return anything, hence never wrong
The SRID is some id, statically generated at Geometry object
construction. It is implementation defined what it is. There seems to
be no documentation whatsoever on the GEOS implementation, and other
references about SRID seem to suggest that there is no such thing as a
failure or invalid answer here.
Bottom line, make wkbSRID return whatever GEOSgetSRID returns, since
there is no condition to test here. Approve test output accordingly.
diffs (108 lines):
diff --git a/geom/monetdb5/geom.mx b/geom/monetdb5/geom.mx
--- a/geom/monetdb5/geom.mx
+++ b/geom/monetdb5/geom.mx
@@ -1116,19 +1116,23 @@
GEOSGeom_destroy(geosGeometry);
+#if @6
if (*out != @5)
+#else
+ if (1 == 1) /* trick compiler for the throw after this return */
+#endif
return MAL_SUCCEED;
throw(MAL, "geom.@1", "@3 failed");
}
@c
-@:basic(Dimension,int,GEOSGeom_getDimensions,,0)@
-@:basic(GeometryTypeId,int,GEOSGeomTypeId,,-1)@
-@:basic(SRID,int,GEOSGetSRID,,0)@
-@:basic(Envelope,wkb*,GEOSEnvelope,geos2wkb,NULL)@
-@:basic(IsEmpty,bit,GEOSisEmpty,,2)@
-@:basic(IsSimple,bit,GEOSisSimple,,2)@
-@:basic(Boundary,wkb*,GEOSBoundary,geos2wkb,NULL)@
+@:basic(Dimension,int,GEOSGeom_getDimensions,,0,1)@
+@:basic(GeometryTypeId,int,GEOSGeomTypeId,,-1,1)@
+@:basic(SRID,int,GEOSGetSRID,,,0)@
+@:basic(Envelope,wkb*,GEOSEnvelope,geos2wkb,NULL,1)@
+@:basic(IsEmpty,bit,GEOSisEmpty,,2,1)@
+@:basic(IsSimple,bit,GEOSisSimple,,2,1)@
+@:basic(Boundary,wkb*,GEOSBoundary,geos2wkb,NULL,1)@
@= spatial
geom_export str
@@ -1256,7 +1260,7 @@
@:analysis(Area,GEOSArea)@
@:analysis(Length,GEOSLength)@
@:analysis2(Distance,GEOSDistance)@
-@:basic(ConvexHull,wkb*,GEOSConvexHull,geos2wkb,NULL)@
+@:basic(ConvexHull,wkb*,GEOSConvexHull,geos2wkb,NULL,1)@
@:analysis3(Intersection,wkb*,GEOSIntersection,geos2wkb)@
@:analysis3(Union,wkb*,GEOSUnion,geos2wkb)@
@:analysis3(Difference,wkb*,GEOSDifference,geos2wkb)@
diff --git a/geom/sql/Tests/basic.stable.err b/geom/sql/Tests/basic.stable.err
--- a/geom/sql/Tests/basic.stable.err
+++ b/geom/sql/Tests/basic.stable.err
@@ -10,31 +10,31 @@
# 09:07:41 > Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb
--host=koala --port=34403
# 09:07:41 >
-MAPI = monetdb@koolmees:38689
+MAPI = monetdb@volund:39079
QUERY = INSERT INTO geoms values ('LINESTRING(10 10)');
ERROR = !MALException:wkb.FromText:IllegalArgumentException: point array must
contain 0 or >1 elements
-MAPI = monetdb@koolmees:38689
+MAPI = monetdb@volund:39079
QUERY = INSERT INTO geoms values ('LINESTRING(10)');
ERROR = !MALException:wkb.FromText:ParseException: Expected number but
encountered ')'
-MAPI = monetdb@koolmees:38689
+MAPI = monetdb@volund:39079
QUERY = INSERT INTO geoms values ('LINESTRING()');
ERROR = !MALException:wkb.FromText:ParseException: Expected number but
encountered ')'
-MAPI = monetdb@koolmees:38689
+MAPI = monetdb@volund:39079
QUERY = INSERT INTO geoms values ('LINESTRING');
ERROR = !MALException:wkb.FromText:ParseException: Expected word but
encountered end of stream
-MAPI = monetdb@koolmees:38689
+MAPI = monetdb@volund:39079
QUERY = INSERT INTO geoms values ('');
ERROR = !MALException:wkb.FromText:ParseException: Expected word but
encountered end of stream
-MAPI = monetdb@koolmees:38689
+MAPI = monetdb@volund:39079
QUERY = INSERT INTO geoms values ('POINT(10)');
ERROR = !MALException:wkb.FromText:ParseException: Expected number but
encountered ')'
-MAPI = monetdb@koolmees:38689
+MAPI = monetdb@volund:39079
QUERY = INSERT INTO geoms values ('POINT()');
ERROR = !MALException:wkb.FromText:ParseException: Expected number but
encountered ')'
-MAPI = monetdb@koolmees:38689
+MAPI = monetdb@volund:39079
QUERY = INSERT INTO geoms values ('POINT');
ERROR = !MALException:wkb.FromText:ParseException: Expected word but
encountered end of stream
-MAPI = monetdb@koolmees:38689
+MAPI = monetdb@volund:39079
QUERY = INSERT INTO geoms values ('');
ERROR = !MALException:wkb.FromText:ParseException: Expected word but
encountered end of stream
diff --git a/geom/sql/Tests/basic.stable.out b/geom/sql/Tests/basic.stable.out
--- a/geom/sql/Tests/basic.stable.out
+++ b/geom/sql/Tests/basic.stable.out
@@ -51,11 +51,12 @@
% sys., sys., sys., sys. # table_name
% dimension_g, geometrytypeid_g, srid_g, envelope_g # name
% int, int, int, geometry # type
-% 1, 1, 2, 0 # length
-[ 3, 0, -1, "POINT (10 10)" ]
-[ 3, 1, -1, "POLYGON ((10 10, 30 10, 30 40, 10 40, 10 10))" ]
-[ 3, 3, -1, "POLYGON ((10 10, 20 10, 20 20, 10 20, 10 10))" ]
-[ 3, 3, -1, "POLYGON ((10 10, 20 10, 20 20, 10 20, 10 10))" ]
+% 1, 1, 1, 0 # length
+[ 3, 0, 0, "POINT (10 10)" ]
+[ 3, 1, 0, "POLYGON ((10 10, 30 10, 30 40, 10 40, 10 10))" ]
+[ 3, 3, 0, "POLYGON ((10 10, 20 10, 20 20, 10 20, 10 10))" ]
+[ 3, 3, 0, "POLYGON ((10 10, 20 10, 20 20, 10 20, 10 10))" ]
+#SELECT IsEmpty(g), IsSimple(g), Boundary(g) FROM geoms where g is not NULL;
% sys., sys., sys. # table_name
% isempty_g, issimple_g, boundary_g # name
% boolean, boolean, geometry # type
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list