[postgis-tickets] r15035 - Fix inconsistency with multilinestring in ST_LocateBetweenElevations()

Sandro Santilli strk at kbt.io
Fri Aug 5 07:09:06 PDT 2016


Author: strk
Date: 2016-08-05 07:09:06 -0700 (Fri, 05 Aug 2016)
New Revision: 15035

Modified:
   trunk/liblwgeom/lwlinearreferencing.c
   trunk/regress/regress_lrs.sql
   trunk/regress/regress_lrs_expected
Log:
Fix inconsistency with multilinestring in ST_LocateBetweenElevations()

Fixes bug #3607.
Includes testcase.

Patch by Artur Zakirov <a.zakirov at postgrespro.ru>

Modified: trunk/liblwgeom/lwlinearreferencing.c
===================================================================
--- trunk/liblwgeom/lwlinearreferencing.c	2016-08-03 21:32:17 UTC (rev 15034)
+++ trunk/liblwgeom/lwlinearreferencing.c	2016-08-05 14:09:06 UTC (rev 15035)
@@ -537,11 +537,6 @@
 		}
 	}
 
-	if ( ! lwgeom_out || lwgeom_out->ngeoms == 0 ) /* Nothing left after clip. */
-	{
-		return NULL;
-	}
-
 	return lwgeom_out;
 
 }

Modified: trunk/regress/regress_lrs.sql
===================================================================
--- trunk/regress/regress_lrs.sql	2016-08-03 21:32:17 UTC (rev 15034)
+++ trunk/regress/regress_lrs.sql	2016-08-05 14:09:06 UTC (rev 15035)
@@ -23,7 +23,13 @@
 select 'LINEZM_4', ST_AsText(ST_LocateBetween('LINESTRING(0 10 100 0, 0 0 0 20, 10 0 0 0)', 2, 18));
 select 'LINEZM_5', ST_AsText(ST_LocateBetween('LINESTRING(0 10 100 0, 0 0 0 20, 0 10 10 40, 10 0 0 0)', 2, 18));
 select 'LINEZM_6', ST_AsText(ST_LocateBetween('LINESTRING(0 10 10 40, 10 0 0 0)', 2, 2));
+-- #3119 --
+select '#3119a', ST_AsText(ST_LocateBetweenElevations('LINESTRING Z(0 0 0, 10 10 10)'::geometry, 11, 11));
 
+-- Multilinestrings
+-- #3119 --
+select '#3119b', ST_AsText(ST_LocateBetweenElevations('MULTILINESTRING Z((0 0 0, 10 10 10))'::geometry, 11, 11));
+
 --- line_locate_point
 
 SELECT 'line_locate_point_1', ST_LineLocatePoint('LINESTRING(709243.393033887 163969.752725768,708943.240904444 163974.593889146,708675.634380651 163981.832927298)', 'POINT(705780 15883)');

Modified: trunk/regress/regress_lrs_expected
===================================================================
--- trunk/regress/regress_lrs_expected	2016-08-03 21:32:17 UTC (rev 15034)
+++ trunk/regress/regress_lrs_expected	2016-08-05 14:09:06 UTC (rev 15035)
@@ -15,6 +15,8 @@
 LINEZM_4|MULTILINESTRING ZM ((0 9 90 2,0 1 10 18),(1 0 0 18,9 0 0 2))
 LINEZM_5|MULTILINESTRING ZM ((0 9 90 2,0 1 10 18),(5.5 4.5 4.5 18,9.5 0.5 0.5 2))
 LINEZM_6|MULTIPOINT ZM (9.5 0.5 0.5 2)
+#3119a|MULTILINESTRING Z EMPTY
+#3119b|MULTILINESTRING Z EMPTY
 line_locate_point_1|0.528602749909894
 line_locate_point_2|1
 line_locate_point_3|0



More information about the postgis-tickets mailing list