diff --git a/doc/html/image_src/Makefile.in b/doc/html/image_src/Makefile.in index c4b520d8f..4cbaf105e 100644 --- a/doc/html/image_src/Makefile.in +++ b/doc/html/image_src/Makefile.in @@ -66,6 +66,8 @@ IMAGES= \ ../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 \ diff --git a/doc/html/image_src/st_shortestline01.wkt b/doc/html/image_src/st_shortestline01.wkt new file mode 100644 index 000000000..7e1f1b168 --- /dev/null +++ b/doc/html/image_src/st_shortestline01.wkt @@ -0,0 +1,3 @@ +Style2;POINT(100 50) +Style2-mediumline;LINESTRING (10 80, 100 199 ) +Style1-thinline;LINESTRING(100 50,28.3145411257356 104.21589326625) diff --git a/doc/html/image_src/st_shortestline02.wkt b/doc/html/image_src/st_shortestline02.wkt new file mode 100644 index 000000000..6c9b2be97 --- /dev/null +++ b/doc/html/image_src/st_shortestline02.wkt @@ -0,0 +1,3 @@ +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) diff --git a/doc/reference_measure.xml b/doc/reference_measure.xml index 7cfec997d..8a149d552 100644 --- a/doc/reference_measure.xml +++ b/doc/reference_measure.xml @@ -1426,12 +1426,54 @@ postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 2, 2 2 ) Examples - - postgis=# SELECT astext(st_shortestline('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry)) as st_shortestline; - st_shortestline + + + + + + + + + + Shortest line between point and line + + + +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) +LINESTRING(100 50,28.3145411257356 104.21589326625) + + + + + + + + + shortest line between polygon and polygon + + + +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) + + + + + + +