../images/st_line_interpolate_point01.png \
../images/st_line_substring01.png \
../images/st_minimumboundingcircle01.png \
+ ../images/st_shortestline01.png \
+ ../images/st_shortestline02.png \
../images/st_symdifference01.png \
../images/st_symdifference02.png \
../images/st_touches01.png \
--- /dev/null
+Style2;POINT(100 50)
+Style2-mediumline;LINESTRING (10 80, 100 199 )
+Style1-thinline;LINESTRING(100 50,28.3145411257356 104.21589326625)
--- /dev/null
+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)
<refsection>
<title>Examples</title>
-
- <programlisting>postgis=# SELECT astext(st_shortestline('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry)) as st_shortestline;
- st_shortestline
+ <informaltable>
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry><para><informalfigure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/st_shortestline01.png" />
+ </imageobject>
+ <caption><para>Shortest line between point and line</para></caption>
+ </mediaobject>
+ </informalfigure>
+ <programlisting>
+SELECT ST_AsText(
+ ST_ShortestLine('POINT(100 50)'::geometry,
+ 'LINESTRING (10 80, 100 199 )'::geometry)
+ ) As sline;
+
+ sline
-----------------
- LINESTRING(0 0,1 1)
-(1 row)</programlisting>
+LINESTRING(100 50,28.3145411257356 104.21589326625)
+ </programlisting>
+ </para></entry>
+
+ <entry><para><informalfigure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/st_shortestline02.png" />
+ </imageobject>
+ <caption><para>shortest line between polygon and polygon</para></caption>
+ </mediaobject>
+ </informalfigure>
+ <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)
+ )
+ ) As slinewkt;
+
+ LINESTRING(100 150,105.845576631004 160.93630466764)
+ </programlisting>
+ </para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+</informaltable>
+
</refsection>
<refsection>