Changeset: e68172cd826e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e68172cd826e
Added Files:
        geom/sql/Tests/functions/Tests/ST_IsValid.sql
        geom/sql/Tests/functions/Tests/ST_IsValid.stable.err
        geom/sql/Tests/functions/Tests/ST_IsValid.stable.out
Removed Files:
        geom/sql/Tests/functions/Tests/isValid.sql
        geom/sql/Tests/functions/Tests/isValid.stable.err
        geom/sql/Tests/functions/Tests/isValid.stable.out
Modified Files:
        geom/monetdb5/geom.h
        geom/monetdb5/geom.mal
        geom/monetdb5/geomBulk.c
        geom/sql/Tests/functions/Tests/All
Branch: geo
Log Message:

ST_IsValid : mTest + bulk


diffs (285 lines):

diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h
--- a/geom/monetdb5/geom.h
+++ b/geom/monetdb5/geom.h
@@ -192,6 +192,8 @@ geom_export str wkbIsRing(bit *out, wkb 
 geom_export str wkbIsRing_bat(bat *inBAT_id, bat *outBAT_id);
 
 geom_export str wkbIsValid(bit *out, wkb **geom);
+geom_export str wkbIsValid_bat(bat *inBAT_id, bat *outBAT_id);
+
 geom_export str wkbIsValidReason(char** out, wkb **geom);
 geom_export str wkbIsValidDetail(char** out, wkb **geom);
 
diff --git a/geom/monetdb5/geom.mal b/geom/monetdb5/geom.mal
--- a/geom/monetdb5/geom.mal
+++ b/geom/monetdb5/geom.mal
@@ -510,6 +510,7 @@ command IsClosed(w:bat[:oid,:wkb]) :bat[
 command IsEmpty(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsEmpty_bat;
 command IsSimple(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsSimple_bat;
 command IsRing(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsRing_bat;
+command IsValid(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsValid_bat;
 
 command pbsmIndexCreate(x:bat[:oid,:dbl], y:bat[:oid,:dbl], xmin:dbl, 
ymin:dbl, xmax:dbl, ymax:dbl) :bat[:oid,:int] address pbsmIndexCreate_bat;
 command geom.pbsmIndexLoad() address pbsmIndexLoad_bat;
diff --git a/geom/monetdb5/geomBulk.c b/geom/monetdb5/geomBulk.c
--- a/geom/monetdb5/geomBulk.c
+++ b/geom/monetdb5/geomBulk.c
@@ -256,6 +256,9 @@ str wkbIsSimple_bat(bat *outBAT_id, bat 
 str wkbIsRing_bat(bat *outBAT_id, bat *inBAT_id) {
        return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsRing, 
"batgeom.wkbIsRing");
 }
+str wkbIsValid_bat(bat *outBAT_id, bat *inBAT_id) {
+       return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsValid, 
"batgeom.wkbIsValid");
+}
 
 /*******************************/
 /********* Two inputs **********/
diff --git a/geom/sql/Tests/functions/Tests/All 
b/geom/sql/Tests/functions/Tests/All
--- a/geom/sql/Tests/functions/Tests/All
+++ b/geom/sql/Tests/functions/Tests/All
@@ -16,9 +16,7 @@ ST_AsText
 ST_IsClosed
 ST_IsEmpty
 ST_IsSimple
-
-#isValid
-
+ST_IsValid
 ST_IsRing
 
 #coordinates
diff --git a/geom/sql/Tests/functions/Tests/isValid.sql 
b/geom/sql/Tests/functions/Tests/ST_IsValid.sql
rename from geom/sql/Tests/functions/Tests/isValid.sql
rename to geom/sql/Tests/functions/Tests/ST_IsValid.sql
--- a/geom/sql/Tests/functions/Tests/isValid.sql
+++ b/geom/sql/Tests/functions/Tests/ST_IsValid.sql
@@ -1,10 +1,10 @@
 create table geo (g geometry(multipoint, 4326));
-insert into geo values (st_mpointfromtext('multipoint(10 10, 20 20, 30 30)', 
4326));
-insert into geo values (st_mpointfromtext('multipoint(10 10, 20 20, 10 10)', 
4326));
+insert into geo values (st_mpointfromtext('MULTIPOINT(10 10, 20 20, 30 30)', 
4326));
+insert into geo values (st_mpointfromtext('MULTIPOINT(10 10, 20 20, 10 10)', 
4326));
 select st_isvalid(g) from geo;
 drop table geo;
 
+select ST_IsValid(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))'));
 
-select ST_IsValid(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))'));
-select ST_IsValidReason(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))'));
+SELECT geom AS "GEOMETRY" FROM geometries WHERE ST_IsValid(geom);
 
diff --git a/geom/sql/Tests/functions/Tests/ST_IsValid.stable.err 
b/geom/sql/Tests/functions/Tests/ST_IsValid.stable.err
new file mode 100644
--- /dev/null
+++ b/geom/sql/Tests/functions/Tests/ST_IsValid.stable.err
@@ -0,0 +1,36 @@
+stderr of test 'ST_IsValid` in directory 'geom/sql/Tests/functions` itself:
+
+
+# 15:17:46 >  
+# 15:17:46 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39488" "--set" 
"mapi_usock=/var/tmp/mtest-8421/.s.monetdb.39488" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions"
 "--set" "mal_listing=0"
+# 15:17:46 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 39488
+# cmdline opt  mapi_usock = /var/tmp/mtest-8421/.s.monetdb.39488
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions
+# cmdline opt  mal_listing = 0
+# cmdline opt  gdk_debug = 536870922
+
+# 15:17:46 >  
+# 15:17:46 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-8421" "--port=39488"
+# 15:17:46 >  
+
+
+# 15:17:47 >  
+# 15:17:47 >  "Done."
+# 15:17:47 >  
+
diff --git a/geom/sql/Tests/functions/Tests/ST_IsValid.stable.out 
b/geom/sql/Tests/functions/Tests/ST_IsValid.stable.out
new file mode 100644
--- /dev/null
+++ b/geom/sql/Tests/functions/Tests/ST_IsValid.stable.out
@@ -0,0 +1,67 @@
+stdout of test 'ST_IsValid` in directory 'geom/sql/Tests/functions` itself:
+
+
+# 15:17:46 >  
+# 15:17:46 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39488" "--set" 
"mapi_usock=/var/tmp/mtest-8421/.s.monetdb.39488" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions"
 "--set" "mal_listing=0"
+# 15:17:46 >  
+
+# MonetDB 5 server v11.20.0
+# This is an unreleased version
+# Serving database 'mTests_geom_sql_Tests_functions', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs and 128bit 
integers dynamically linked
+# Found 15.356 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://sibuyan.da.cwi.nl:39488/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-8421/.s.monetdb.39488
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 15:17:46 >  
+# 15:17:46 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-8421" "--port=39488"
+# 15:17:46 >  
+
+#create table geo (g geometry(multipoint, 4326));
+#insert into geo values (st_mpointfromtext('MULTIPOINT(10 10, 20 20, 30 30)', 
4326));
+[ 1    ]
+#insert into geo values (st_mpointfromtext('MULTIPOINT(10 10, 20 20, 10 10)', 
4326));
+[ 1    ]
+#select st_isvalid(g) from geo;
+% sys.L # table_name
+% st_isvalid_g # name
+% boolean # type
+% 5 # length
+[ true ]
+[ true ]
+#drop table geo;
+#select ST_IsValid(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))'));
+% .L # table_name
+% st_geomfromtext_single_value # name
+% boolean # type
+% 5 # length
+[ false        ]
+#SELECT geom AS "GEOMETRY" FROM geometries WHERE ST_IsValid(geom);
+% sys.L # table_name
+% GEOMETRY # name
+% geometry # type
+% 0 # length
+[ "POINT (10 20)"      ]
+[ "LINESTRING (10 20, 30 40, 50 60)"   ]
+[ "LINESTRING (10 20, 30 40, 50 60, 80 60, 60 40, 10 20)"      ]
+[ "LINESTRING (10 10, 50 50, 30 80, 25 5)"     ]
+[ "POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10))"      ]
+[ "MULTIPOINT (10 20, 30 40)"  ]
+[ "MULTILINESTRING ((30 40, 40 50), (50 60, 60 70))"   ]
+[ "MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 60 70))"    ]
+[ "MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 40 50, 20 30, 50 60))"      
]
+[ "MULTIPOLYGON EMPTY" ]
+[ "GEOMETRYCOLLECTION (POINT (10 20), LINESTRING (10 20, 30 40), POLYGON ((10 
10, 10 20, 20 20, 20 10, 10 10)))"       ]
+[ "GEOMETRYCOLLECTION (POINT (10 20), LINESTRING (10 20, 30 40, 10 20), 
POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10)))"        ]
+
+# 15:17:47 >  
+# 15:17:47 >  "Done."
+# 15:17:47 >  
+
diff --git a/geom/sql/Tests/functions/Tests/isValid.stable.err 
b/geom/sql/Tests/functions/Tests/isValid.stable.err
deleted file mode 100644
--- a/geom/sql/Tests/functions/Tests/isValid.stable.err
+++ /dev/null
@@ -1,36 +0,0 @@
-stderr of test 'isValid` in directory 'geom/sql/Tests/functions` itself:
-
-
-# 10:52:09 >  
-# 10:52:09 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39851" "--set" 
"mapi_usock=/var/tmp/mtest-4010/.s.monetdb.39851" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions"
 "--set" "mal_listing=0"
-# 10:52:09 >  
-
-# builtin opt  gdk_dbpath = 
/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/monetdb5/dbfarm/demo
-# builtin opt  gdk_debug = 0
-# builtin opt  gdk_vmtrim = no
-# builtin opt  monet_prompt = >
-# builtin opt  monet_daemon = no
-# builtin opt  mapi_port = 50000
-# builtin opt  mapi_open = false
-# builtin opt  mapi_autosense = false
-# builtin opt  sql_optimizer = default_pipe
-# builtin opt  sql_debug = 0
-# cmdline opt  gdk_nr_threads = 0
-# cmdline opt  mapi_open = true
-# cmdline opt  mapi_port = 39851
-# cmdline opt  mapi_usock = /var/tmp/mtest-4010/.s.monetdb.39851
-# cmdline opt  monet_prompt = 
-# cmdline opt  mal_listing = 2
-# cmdline opt  gdk_dbpath = 
/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions
-# cmdline opt  mal_listing = 0
-# cmdline opt  gdk_debug = 536870922
-
-# 10:52:09 >  
-# 10:52:09 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-4010" "--port=39851"
-# 10:52:09 >  
-
-
-# 10:52:09 >  
-# 10:52:09 >  "Done."
-# 10:52:09 >  
-
diff --git a/geom/sql/Tests/functions/Tests/isValid.stable.out 
b/geom/sql/Tests/functions/Tests/isValid.stable.out
deleted file mode 100644
--- a/geom/sql/Tests/functions/Tests/isValid.stable.out
+++ /dev/null
@@ -1,56 +0,0 @@
-stdout of test 'isValid` in directory 'geom/sql/Tests/functions` itself:
-
-
-# 10:52:09 >  
-# 10:52:09 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39851" "--set" 
"mapi_usock=/var/tmp/mtest-4010/.s.monetdb.39851" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions"
 "--set" "mal_listing=0"
-# 10:52:09 >  
-
-# MonetDB 5 server v11.20.0
-# This is an unreleased version
-# Serving database 'mTests_geom_sql_Tests_functions', using 8 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs and 128bit 
integers dynamically linked
-# Found 15.356 GiB available main-memory.
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
-# Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://sibuyan.da.cwi.nl:39851/
-# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-4010/.s.monetdb.39851
-# MonetDB/GIS module loaded
-# MonetDB/SQL module loaded
-
-Ready.
-
-# 10:52:09 >  
-# 10:52:09 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-4010" "--port=39851"
-# 10:52:09 >  
-
-#create table geo (g geometry(multipoint, 4326));
-#insert into geo values (st_mpointfromtext('multipoint(10 10, 20 20, 30 30)', 
4326));
-[ 1    ]
-#insert into geo values (st_mpointfromtext('multipoint(10 10, 20 20, 10 10)', 
4326));
-[ 1    ]
-#select st_isvalid(g) from geo;
-% sys.L # table_name
-% st_isvalid_g # name
-% boolean # type
-% 5 # length
-[ true ]
-[ true ]
-#drop table geo;
-#select ST_IsValid(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))'));
-% .L # table_name
-% st_geomfromtext_single_value # name
-% boolean # type
-% 5 # length
-[ false        ]
-#select ST_IsValidReason(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 
0))'));
-% .L # table_name
-% st_geomfromtext_single_value # name
-% clob # type
-% 22 # length
-[ "Self-intersection[0 0]"     ]
-
-# 10:52:09 >  
-# 10:52:09 >  "Done."
-# 10:52:09 >  
-
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to