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

Sandro Santilli strk at kbt.io
Fri Aug 5 07:11:18 PDT 2016


Author: strk
Date: 2016-08-05 07:11:18 -0700 (Fri, 05 Aug 2016)
New Revision: 15036

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

Fixes #3607.
Includes testcase.

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

Modified: branches/2.2/NEWS
===================================================================
--- branches/2.2/NEWS	2016-08-05 14:09:06 UTC (rev 15035)
+++ branches/2.2/NEWS	2016-08-05 14:11:18 UTC (rev 15036)
@@ -14,6 +14,8 @@
   - #3515, tiger_data not being backed up
   - #3602, perl as found by configure is not used 
   			in tiger extension, postgis_sfcgal, address_standardizer  
+  - #3607, Fix inconsistency with multilinestring in
+           ST_LocateBetweenElevations (Artur Zakirov)
 
 
 PostGIS 2.2.2

Modified: branches/2.2/liblwgeom/lwlinearreferencing.c
===================================================================
--- branches/2.2/liblwgeom/lwlinearreferencing.c	2016-08-05 14:09:06 UTC (rev 15035)
+++ branches/2.2/liblwgeom/lwlinearreferencing.c	2016-08-05 14:11:18 UTC (rev 15036)
@@ -524,11 +524,6 @@
 		}
 	}
 
-	if ( ! lwgeom_out || lwgeom_out->ngeoms == 0 ) /* Nothing left after clip. */
-	{
-		return NULL;
-	}
-
 	return lwgeom_out;
 
 }

Modified: branches/2.2/regress/regress_lrs.sql
===================================================================
--- branches/2.2/regress/regress_lrs.sql	2016-08-05 14:09:06 UTC (rev 15035)
+++ branches/2.2/regress/regress_lrs.sql	2016-08-05 14:11:18 UTC (rev 15036)
@@ -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: branches/2.2/regress/regress_lrs_expected
===================================================================
--- branches/2.2/regress/regress_lrs_expected	2016-08-05 14:09:06 UTC (rev 15035)
+++ branches/2.2/regress/regress_lrs_expected	2016-08-05 14:11:18 UTC (rev 15036)
@@ -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