| | 10548 | <refpurpose>Returns the 2-dimensional shortest line between two geometries</refpurpose> |
| | 10549 | </refnamediv> |
| | 10550 | |
| | 10551 | <refsynopsisdiv> |
| | 10552 | <funcsynopsis> |
| | 10553 | <funcprototype> |
| | 10554 | <funcdef>geometry <function>ST_ShortestLine</function></funcdef> |
| | 10555 | |
| | 10556 | <paramdef><type>geometry </type> |
| | 10557 | <parameter>g1</parameter></paramdef> |
| | 10558 | |
| | 10559 | <paramdef><type>geometry </type> |
| | 10560 | <parameter>g2</parameter></paramdef> |
| | 10561 | </funcprototype> |
| | 10562 | </funcsynopsis> |
| | 10563 | </refsynopsisdiv> |
| | 10564 | |
| | 10565 | <refsection> |
| | 10566 | <title>Description</title> |
| | 10567 | |
| | 10568 | <para>Returns the 2-dimensional shortest line between two geometries. The function will |
| | 10569 | only return the first shortest line if more than one, that the function finds. |
| | 10570 | If g1 and g2 intersects in just one point the function will return a line with both start |
| | 10571 | and end in that intersection-point. |
| | 10572 | If g1 and g2 are intersecting with more than one point the function will return a line with start |
| | 10573 | and end in the same point but it can be any of the intersecting points. |
| | 10574 | The line returned will always start in g1 and end in g2. |
| | 10575 | The length of the line this function returns will always be the same as st_distance returns for g1 and g2. |
| | 10576 | </para> |
| | 10577 | |
| | 10578 | </refsection> |
| | 10579 | |
| | 10580 | <refsection> |
| | 10581 | <title>Examples</title> |
| | 10582 | |
| | 10583 | <programlisting>postgis=# SELECT astext(st_shortestline('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry));; |
| | 10584 | st_shortestline |
| | 10585 | ----------------- |
| | 10586 | "LINESTRING(0 0,1 1)" |
| | 10587 | (1 row)</programlisting> |
| | 10588 | </refsection> |
| | 10589 | |
| | 10590 | <refsection> |
| | 10591 | <title>See Also</title> |
| | 10592 | |
| | 10593 | <para><xref linkend="ST_Distance"/><xref linkend="ST_ShortestLine"/></para> |
| | 10594 | </refsection> |
| | 10595 | </refentry> |
| | 10596 | |
| | 10597 | <refentry id="ST_LongestLine"> |
| | 10598 | <refnamediv> |
| | 10599 | <refname>ST_LongestLine</refname> |
| | 10600 | |
| | 10601 | <refpurpose>Returns the 2-dimensional longest line points of two geometries. |
| | 10602 | The function will only return the first longest line if more than one, that the function finds. |
| | 10603 | The line returned will always start in g1 and end in g2. |
| | 10604 | The length of the line this function returns will always be the same as st_max_distance returns for g1 and g2.</refpurpose> |
| | 10605 | </refnamediv> |
| | 10606 | |
| | 10607 | <refsynopsisdiv> |
| | 10608 | <funcsynopsis> |
| | 10609 | <funcprototype> |
| | 10610 | <funcdef>geometry <function>ST_LongestLine</function></funcdef> |
| | 10611 | |
| | 10612 | <paramdef><type>geometry </type> |
| | 10613 | <parameter>g1</parameter></paramdef> |
| | 10614 | |
| | 10615 | <paramdef><type>geometry </type> |
| | 10616 | <parameter>g2</parameter></paramdef> |
| | 10617 | </funcprototype> |
| | 10618 | </funcsynopsis> |
| | 10619 | </refsynopsisdiv> |
| | 10620 | |
| | 10621 | <refsection> |
| | 10622 | <title>Description</title> |
| | 10623 | |
| | 10624 | <para>Returns the 2-dimensional longest line between the points of two geometries. |
| | 10625 | </para> |
| | 10626 | |
| | 10627 | </refsection> |
| | 10628 | |
| | 10629 | <refsection> |
| | 10630 | <title>Examples</title> |
| | 10631 | |
| | 10632 | <programlisting>postgis=# SELECT astext(st_longestline('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry));; |
| | 10633 | st_shortestline |
| | 10634 | ----------------- |
| | 10635 | "LINESTRING(0 0,2 0)" |
| | 10636 | (1 row)</programlisting> |
| | 10637 | </refsection> |
| | 10638 | |
| | 10639 | <refsection> |
| | 10640 | <title>See Also</title> |
| | 10641 | |
| | 10642 | <para><xref linkend="ST_Max_Distance"/><xref linkend="ST_ShortestLine"/></para> |
| | 10643 | </refsection> |
| | 10644 | </refentry> |
| | 10645 | |
| | 10646 | |