]> granicus.if.org Git - postgis/commitdiff
Set interface specs in stone within the implementation file, add a testcase to show...
authorSandro Santilli <strk@keybit.net>
Thu, 11 Mar 2010 20:34:01 +0000 (20:34 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 11 Mar 2010 20:34:01 +0000 (20:34 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@5414 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_geos_split.c
regress/split.sql
regress/split_expected

index a890396662b81c13d1afc96b294f05132b245c48..5c7b5240686ecfdda49a2de818b8473432b9abdc 100644 (file)
  * ST_SplitGeometry
  *
  * Split polygon by line, line by line, line by point.
- * Returns components as a collection
+ * Returns at most components as a collection.
+ * First element of the collection is always the part which
+ * remains after the cut, while the second element is the
+ * part which has been cut out. We arbitrarely take the part
+ * on the *right* of cut lines as the part which has been cut out.
+ * For a line cut by a point the part which remains is the one
+ * from start of the line to the cut point.
+ *
  *
  * Author: Sandro Santilli <strk@keybit.net>
  *
index be86daefa7d57d93cc4fadae3f4daa112e5ba8f0..f9fdeae059990df37ad1bba8b616f869b5df8ef6 100644 (file)
@@ -1,6 +1,8 @@
 -- Point on line
 select '1',st_asewkt(st_splitgeometry('SRID=10;LINESTRING(0 0, 10 0)', 'POINT(5 0)'));
 
+select '1.1',st_asewkt(st_splitgeometry('SRID=10;LINESTRING(10 0, 0 0)', 'POINT(5 0)'));
+
 -- Point on line boundary
 select '2',st_asewkt(st_splitgeometry('SRID=10;LINESTRING(0 0, 10 0)', 'POINT(10 0)'));
 
index 8e40501aacbb0a18a6b60e3694a67af99988e21b..a9937352d239ee5775cdbab005c2d3da16d5fef1 100644 (file)
@@ -1,3 +1,4 @@
 1|SRID=10;GEOMETRYCOLLECTION(LINESTRING(0 0,5 0),LINESTRING(5 0,10 0))
+1.1|SRID=10;GEOMETRYCOLLECTION(LINESTRING(10 0,5 0),LINESTRING(5 0,0 0))
 2|SRID=10;GEOMETRYCOLLECTION(LINESTRING(0 0,10 0))
 3|SRID=10;GEOMETRYCOLLECTION(LINESTRING(0 0,10 0))