[SCM] PostGIS branch master updated. 3.6.0rc2-614-gafc9284ef

git at osgeo.org git at osgeo.org
Thu Jun 18 10:42:25 PDT 2026


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  afc9284efd51e84ce985e3637e5177fe93f41e36 (commit)
      from  fc2a5bdd5ea9e0f9a26a9374e0d3bb69ae4288b3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit afc9284efd51e84ce985e3637e5177fe93f41e36
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Thu Jun 18 21:33:25 2026 +0400

    doc: clarify ST_LineSubstring 2D fractions
    
    References #5776
    Closes https://github.com/postgis/postgis/pull/956

diff --git a/doc/reference_lrs.xml b/doc/reference_lrs.xml
index c0c797c65..8080dedfb 100644
--- a/doc/reference_lrs.xml
+++ b/doc/reference_lrs.xml
@@ -381,8 +381,8 @@ FROM (SELECT ST_GeomFromText('LINESTRING(1 2, 4 5, 6 7)') As the_line) As foo;
 			starting and ending at the given fractional locations.
             The first argument must be a LINESTRING.
 			The second and third arguments are values in the range [0, 1]
-            representing the start and end locations
-            as fractions of line length.
+            representing the start and end locations.
+            For geometry inputs, the fractions are measured in 2D line length.
             The Z and M values are interpolated for added endpoints if present.
             </para>
 
@@ -479,6 +479,23 @@ SELECT ST_AsText(ST_LineSubstring( 'LINESTRING(-118.2436 34.0522, -71.0570 42.36
 geog_sub | LINESTRING(-104.167064 38.854691,-87.674646 41.849854)
 geom_sub | LINESTRING(-102.530462 36.819064,-86.817324 39.585927)
 </programlisting>
+
+	<para>For geometry inputs, the fractional locations are based on the 2D
+	length of the line, even when the input has Z values. The resulting Z values
+	are interpolated along the selected 2D location.</para>
+	<programlisting>
+	WITH data AS (
+	  SELECT 'LINESTRING Z (0 0 0, 0 2 5, 0 10 10)'::geometry AS geom
+	)
+	SELECT ST_Length(geom) AS length_2d,
+	       ST_3DLength(geom) AS length_3d,
+	       ST_AsText(ST_LineSubstring(geom, 0, 0.5)) AS substring
+	FROM data;
+
+	 length_2d |    length_3d     |              substring
+	-----------+------------------+-------------------------------------
+	        10 | 14.8191459391911 | LINESTRING Z (0 0 0,0 2 5,0 5 6.875)
+	</programlisting>
 		  </refsection>
 
 		  <!-- Optionally add a "See Also" section -->

-----------------------------------------------------------------------

Summary of changes:
 doc/reference_lrs.xml | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list