]> granicus.if.org Git - postgis/commitdiff
Fix inconsistency with multilinestring in ST_LocateBetweenElevations()
authorSandro Santilli <strk@kbt.io>
Fri, 5 Aug 2016 14:09:06 +0000 (14:09 +0000)
committerSandro Santilli <strk@kbt.io>
Fri, 5 Aug 2016 14:09:06 +0000 (14:09 +0000)
Fixes bug #3607.
Includes testcase.

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

git-svn-id: http://svn.osgeo.org/postgis/trunk@15035 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwlinearreferencing.c
regress/regress_lrs.sql
regress/regress_lrs_expected

index 3cbf42386032d7c4edf928334feaaf03f4ccb863..fdd8c6301fd85e8828aacd990f6aa96191828325 100644 (file)
@@ -537,11 +537,6 @@ lwmline_clip_to_ordinate_range(const LWMLINE *mline, char ordinate, double from,
                }
        }
 
-       if ( ! lwgeom_out || lwgeom_out->ngeoms == 0 ) /* Nothing left after clip. */
-       {
-               return NULL;
-       }
-
        return lwgeom_out;
 
 }
index ca78b4f66d84761100c25015bc2bba82126b25bb..a362d9a1becb86c3f06f9b746fc81a9455c9aedd 100644 (file)
@@ -23,6 +23,12 @@ select 'LINEZM_3', ST_AsText(ST_LocateBetween('LINESTRING(0 10 100 0, 0 0 0 10,
 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
 
index 54ae3ff7f6fac202b20ff6aafd59a7346a69e429..a61cc04b3dc93d135c1a1c34fdb8457066485f05 100644 (file)
@@ -15,6 +15,8 @@ LINEZM_3|MULTILINESTRING ZM ((0 8 80 2,0 0 0 10,8 0 0 2))
 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