../images/st_linecrossingdirection04.png \
../images/st_line_interpolate_point01.png \
../images/st_line_substring01.png \
+ ../images/st_longestline01.png \
+ ../images/st_longestline02.png \
../images/st_minimumboundingcircle01.png \
../images/st_shortestline01.png \
../images/st_shortestline02.png \
--- /dev/null
+Style2;POINT(100 50)
+Style2-mediumline;LINESTRING (10 80, 100 199 )
+Style1-thinline;LINESTRING(100 50,100 199)
--- /dev/null
+Style2;POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))
+Style2-mediumline;POLYGON((130 170,129.615705608065 166.098193559677,128.477590650226 162.346331352698,126.629392246051 158.888595339608,124.142135623731 155.857864376269,121.111404660392 153.370607753949,117.653668647302 151.522409349774,113.901806440323 150.384294391935,110 150,106.098193559677 150.384294391935,102.346331352698 151.522409349774,98.888595339608 153.370607753949,95.8578643762691 155.857864376269,93.3706077539491 158.888595339608,91.5224093497743 162.346331352698,90.3842943919354 166.098193559677,90 170,90.3842943919354 173.901806440323,91.5224093497742 177.653668647302,93.3706077539491 181.111404660392,95.857864376269 184.142135623731,98.8885953396079 186.629392246051,102.346331352698 188.477590650226,106.098193559677 189.615705608065,110 190,113.901806440323 189.615705608065,117.653668647302 188.477590650226,121.111404660392 186.629392246051,124.142135623731 184.142135623731,126.629392246051 181.111404660392,128.477590650226 177.653668647302,129.615705608065 173.901806440323,130 170))
+Style1-thinline;LINESTRING(20 40,121.111404660392 186.629392246051)
-Style2;POLYGON((100 150, 20 40, 50 60, 80 100, 100 150))
-Style2-mediumline;POLYGON((120 170,119.807852804032 168.049096779839,119.238795325113 166.173165676349,118.314696123025 164.444297669804,117.071067811865 162.928932188135,115.555702330196 161.685303876975,113.826834323651 160.761204674887,111.950903220161 160.192147195968,110 160,108.049096779839 160.192147195968,106.173165676349 160.761204674887,104.444297669804 161.685303876975,102.928932188135 162.928932188135,101.685303876975 164.444297669804,100.761204674887 166.173165676349,100.192147195968 168.049096779839,100 170,100.192147195968 171.950903220161,100.761204674887 173.826834323651,101.685303876975 175.555702330196,102.928932188135 177.071067811865,104.444297669804 178.314696123025,106.173165676349 179.238795325113,108.049096779839 179.807852804032,110 180,111.950903220161 179.807852804032,113.826834323651 179.238795325113,115.555702330196 178.314696123025,117.071067811865 177.071067811866,118.314696123025 175.555702330196,119.238795325113 173.826834323651,119.807852804032 171.950903220161,120 170))
-Style1-thinline;LINESTRING(100 150,105.845576631004 160.93630466764)
+Style2;POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))
+Style2-mediumline;POLYGON((130 170,129.615705608065 166.098193559677,128.477590650226 162.346331352698,126.629392246051 158.888595339608,124.142135623731 155.857864376269,121.111404660392 153.370607753949,117.653668647302 151.522409349774,113.901806440323 150.384294391935,110 150,106.098193559677 150.384294391935,102.346331352698 151.522409349774,98.888595339608 153.370607753949,95.8578643762691 155.857864376269,93.3706077539491 158.888595339608,91.5224093497743 162.346331352698,90.3842943919354 166.098193559677,90 170,90.3842943919354 173.901806440323,91.5224093497742 177.653668647302,93.3706077539491 181.111404660392,95.857864376269 184.142135623731,98.8885953396079 186.629392246051,102.346331352698 188.477590650226,106.098193559677 189.615705608065,110 190,113.901806440323 189.615705608065,117.653668647302 188.477590650226,121.111404660392 186.629392246051,124.142135623731 184.142135623731,126.629392246051 181.111404660392,128.477590650226 177.653668647302,129.615705608065 173.901806440323,130 170))
+Style1-thinline;LINESTRING(140.752120669087 125.695053378061,121.111404660392 153.370607753949)
<programlisting>
SELECT ST_AsText(
ST_ShortestLine(
- ST_GeomFromText('POLYGON((100 150, 20 40, 50 60, 80 100, 100 150))'),
- ST_Buffer(ST_GeomFromText('POINT(110 170)'), 10)
+ ST_GeomFromText('POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))'),
+ ST_Buffer(ST_GeomFromText('POINT(110 170)'), 20)
)
) As slinewkt;
- LINESTRING(100 150,105.845576631004 160.93630466764)
+ LINESTRING(140.752120669087 125.695053378061,121.111404660392 153.370607753949)
</programlisting>
</para></entry>
</row>
<refsection>
<title>Examples</title>
+ <informaltable>
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry><para><informalfigure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/st_longestline01.png" />
+ </imageobject>
+ <caption><para>Longest line between point and line</para></caption>
+ </mediaobject>
+ </informalfigure>
+ <programlisting>
+SELECT ST_AsText(
+ ST_LongestLine('POINT(100 50)'::geometry,
+ 'LINESTRING (10 80, 100 199 )'::geometry)
+ ) As lline;
+
+ lline
+-----------------
+LINESTRING(100 50,100 199)
+ </programlisting>
+ </para></entry>
- <programlisting>postgis=# SELECT astext(st_longestline('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry)) as st_longestline;
- st_longestline
+ <entry><para><informalfigure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/st_longestline02.png" />
+ </imageobject>
+ <caption><para>longest line between polygon and polygon</para></caption>
+ </mediaobject>
+ </informalfigure>
+ <programlisting>
+SELECT ST_AsText(
+ ST_LongestLine(
+ ST_GeomFromText('POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))'),
+ ST_Buffer(ST_GeomFromText('POINT(110 170)'), 20)
+ )
+ ) As llinewkt;
+
+ lline
-----------------
- LINESTRING(0 0,2 0)
-(1 row)</programlisting>
+LINESTRING(20 40,121.111404660392 186.629392246051)
+ </programlisting>
+ </para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+</informaltable>
</refsection>
<refsection>