Skip to content

Commit 7915c4c

Browse files
committed
ST_LocateBetween[Elevations]: support TIN and TRIANGLE clipping.
Triangle is converted into a TIN that has several triangles with same orientation. Committed in Paris Airport. Closes #4155 git-svn-id: http://svn.osgeo.org/postgis/trunk@16954 b70326c6-7e19-0410-871a-916f4a2858ee
1 parent 7538e45 commit 7915c4c

File tree

4 files changed

+160
-74
lines changed

4 files changed

+160
-74
lines changed

NEWS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ PostGIS 3.0.0
2727
Praliaskouski)
2828
- #3457, Fix raster envelope shortcut in ST_Clip (Sai-bot)
2929
- #4215, Use floating point compare in ST_DumpAsPolygons (Darafei Praliaskouski)
30-
- #4155, Support for GEOMETRYCOLLECTION and POLYGON in ST_LocateBetween (Darafei
31-
Praliaskouski)
30+
- #4155, Support for GEOMETRYCOLLECTION, POLYGON, TIN, TRIANGLE in
31+
ST_LocateBetween and ST_LocateBetweenElevations (Darafei Praliaskouski)
3232

3333
PostGIS 2.5.0
3434
2018/09/23

doc/reference_lrs.xml

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -426,15 +426,14 @@ SELECT ST_AsText((ST_Dump(the_geom)).geom)
426426
<refname>ST_LocateBetween</refname>
427427

428428
<refpurpose>Return a derived geometry collection value with elements
429-
that match the specified range of measures inclusively. Polygonal
430-
elements are not supported.</refpurpose>
429+
that match the specified range of measures inclusively.</refpurpose>
431430
</refnamediv>
432431

433432
<refsynopsisdiv>
434433
<funcsynopsis>
435434
<funcprototype>
436435
<funcdef>geometry <function>ST_LocateBetween</function></funcdef>
437-
<paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
436+
<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
438437
<paramdef><type>float8 </type> <parameter>measure_start</parameter></paramdef>
439438
<paramdef><type>float8 </type> <parameter>measure_end</parameter></paramdef>
440439
<paramdef choice="opt"><type>float8 </type> <parameter>offset</parameter></paramdef>
@@ -447,7 +446,9 @@ SELECT ST_AsText((ST_Dump(the_geom)).geom)
447446
<title>Description</title>
448447

449448
<para>Return a derived geometry collection with elements that match the specified range of
450-
measures inclusively. Polygonal elements are not supported.</para>
449+
measures inclusively.</para>
450+
451+
<para>Clipping a non-convex POLYGON may produce invalid geometry.</para>
451452

452453
<para>If an offset is provided, the resultant will be offset to the left or right of the
453454
input line by the specified number of units. A positive offset will be to the left, and
@@ -458,18 +459,23 @@ SELECT ST_AsText((ST_Dump(the_geom)).geom)
458459

459460
<para>Availability: 1.1.0 by old name ST_Locate_Between_Measures. </para>
460461
<para>Changed: 2.0.0 - in prior versions this used to be called ST_Locate_Between_Measures. The old name has been deprecated and will be removed in the future but is still available for backward compatibility.</para>
462+
<para>Enhanced: 3.0.0 - added support for POLYGON, TIN, TRIANGLE.</para>
461463

462464
<para>&M_support;</para>
463465
</refsection>
464466

465467
<refsection>
466468
<title>Examples</title>
467469

468-
<programlisting>SELECT ST_AsText(the_geom)
469-
FROM
470-
(SELECT ST_LocateBetween(
471-
ST_GeomFromText('MULTILINESTRING M ((1 2 3, 3 4 2, 9 4 3),
472-
(1 2 3, 5 4 5))'),1.5, 3) As the_geom) As foo;
470+
<programlisting>
471+
SELECT ST_AsText(the_geom)
472+
FROM (
473+
SELECT ST_LocateBetween(
474+
'MULTILINESTRING M ((1 2 3, 3 4 2, 9 4 3),(1 2 3, 5 4 5))'),
475+
1.5,
476+
3
477+
) as the_geom
478+
) As foo;
473479

474480
st_asewkt
475481
------------------------------------------------------------------------
@@ -478,10 +484,13 @@ SELECT ST_AsText((ST_Dump(the_geom)).geom)
478484
--Geometry collections are difficult animals so dump them
479485
--to make them more digestable
480486
SELECT ST_AsText((ST_Dump(the_geom)).geom)
481-
FROM
482-
(SELECT ST_LocateBetween(
483-
ST_GeomFromText('MULTILINESTRING M ((1 2 3, 3 4 2, 9 4 3),
484-
(1 2 3, 5 4 5))'),1.5, 3) As the_geom) As foo;
487+
FROM (
488+
SELECT ST_LocateBetween(
489+
'MULTILINESTRING M ((1 2 3, 3 4 2, 9 4 3),(1 2 3, 5 4 5))'),
490+
1.5,
491+
3
492+
) As the_geom
493+
) As foo;
485494

486495
st_asewkt
487496
--------------------------------
@@ -502,15 +511,14 @@ SELECT ST_AsText((ST_Dump(the_geom)).geom)
502511
<refname>ST_LocateBetweenElevations</refname>
503512

504513
<refpurpose>Return a derived geometry (collection) value with elements
505-
that intersect the specified range of elevations inclusively. Only 3D, 4D LINESTRINGS and MULTILINESTRINGS
506-
are supported.</refpurpose>
514+
that intersect the specified range of elevations inclusively.</refpurpose>
507515
</refnamediv>
508516

509517
<refsynopsisdiv>
510518
<funcsynopsis>
511519
<funcprototype>
512520
<funcdef>geometry <function>ST_LocateBetweenElevations</function></funcdef>
513-
<paramdef><type>geometry </type> <parameter>geom_mline</parameter></paramdef>
521+
<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
514522
<paramdef><type>float8 </type> <parameter>elevation_start</parameter></paramdef>
515523
<paramdef><type>float8 </type> <parameter>elevation_end</parameter></paramdef>
516524
</funcprototype>
@@ -521,11 +529,13 @@ SELECT ST_AsText((ST_Dump(the_geom)).geom)
521529
<refsection>
522530
<title>Description</title>
523531

524-
<para>Return a derived geometry (collection) value with elements
525-
that intersect the specified range of elevations inclusively. Only 3D, 3DM LINESTRINGS and MULTILINESTRINGS
526-
are supported.</para>
532+
<para>Return a derived geometry (collection) value with elements
533+
that intersect the specified range of elevations inclusively.</para>
527534

528-
<para>Availability: 1.4.0</para>
535+
<para>Clipping a non-convex POLYGON may produce invalid geometry.</para>
536+
537+
<para>Availability: 1.4.0</para>
538+
<para>Enhanced: 3.0.0 - added support for POLYGON, TIN, TRIANGLE.</para>
529539

530540
<para>&Z_support;</para>
531541
</refsection>
@@ -534,24 +544,22 @@ SELECT ST_AsText((ST_Dump(the_geom)).geom)
534544
<title>Examples</title>
535545

536546
<programlisting>SELECT ST_AsEWKT(ST_LocateBetweenElevations(
537-
ST_GeomFromEWKT('LINESTRING(1 2 3, 4 5 6)'),2,4)) As ewelev;
547+
ST_GeomFromEWKT('LINESTRING(1 2 3, 4 5 6)'), 2, 4)) As ewelev;
538548
ewelev
539549
----------------------------------------------------------------
540550
MULTILINESTRING((1 2 3,2 3 4))
541551

542-
SELECT ST_AsEWKT(ST_LocateBetweenElevations(
543-
ST_GeomFromEWKT('LINESTRING(1 2 6, 4 5 -1, 7 8 9)'),6,9)) As ewelev;
552+
SELECT ST_AsEWKT(ST_LocateBetweenElevations('LINESTRING(1 2 6, 4 5 -1, 7 8 9)', 6, 9)) As ewelev;
544553

545554
ewelev
546555
----------------------------------------------------------------
547556
GEOMETRYCOLLECTION(POINT(1 2 6),LINESTRING(6.1 7.1 6,7 8 9))
548557

549-
--Geometry collections are difficult animals so dump them
550-
--to make them more digestable
558+
-- Geometry collections are difficult animals so dump them
559+
-- to make them more digestable
551560
SELECT ST_AsEWKT((ST_Dump(the_geom)).geom)
552-
FROM
553-
(SELECT ST_LocateBetweenElevations(
554-
ST_GeomFromEWKT('LINESTRING(1 2 6, 4 5 -1, 7 8 9)'),6,9) As the_geom) As foo;
561+
FROM
562+
(SELECT ST_LocateBetweenElevations('LINESTRING(1 2 6, 4 5 -1, 7 8 9)', 6, 9) as the_geom) As foo;
555563

556564
st_asewkt
557565
--------------------------------
@@ -564,7 +572,7 @@ LINESTRING(6.1 7.1 6,7 8 9)
564572
<refsection>
565573
<title>See Also</title>
566574

567-
<para><xref linkend="ST_Dump" /></para>
575+
<para><xref linkend="ST_Dump" />, <xref linkend="ST_LocateBetween" /></para>
568576
</refsection>
569577
</refentry>
570578

0 commit comments

Comments
 (0)