From 34fda3bee9497496ecfb99d09e17dcd40123de46 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Thu, 26 Nov 2009 18:50:03 +0000 Subject: [PATCH] another st_longestline example git-svn-id: http://svn.osgeo.org/postgis/trunk@4907 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/html/image_src/Makefile.in | 1 + doc/html/image_src/st_longestline03.wkt | 2 ++ doc/reference_measure.xml | 46 ++++++++++++++++--------- 3 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 doc/html/image_src/st_longestline03.wkt diff --git a/doc/html/image_src/Makefile.in b/doc/html/image_src/Makefile.in index e3e907259..e0abf824c 100644 --- a/doc/html/image_src/Makefile.in +++ b/doc/html/image_src/Makefile.in @@ -67,6 +67,7 @@ IMAGES= \ ../images/st_line_substring01.png \ ../images/st_longestline01.png \ ../images/st_longestline02.png \ + ../images/st_longestline03.png \ ../images/st_minimumboundingcircle01.png \ ../images/st_shortestline01.png \ ../images/st_shortestline02.png \ diff --git a/doc/html/image_src/st_longestline03.wkt b/doc/html/image_src/st_longestline03.wkt new file mode 100644 index 000000000..ec35e4d75 --- /dev/null +++ b/doc/html/image_src/st_longestline03.wkt @@ -0,0 +1,2 @@ +Style2;POLYGON((6107065 2328604,6091208 2323033,6092928 2305612,6074587 2305837,6074751 2268328,6042817 2267620,6045939 2248058,6013411 2248863,6029972 2264283,5991220 2358173,6071023 2376046,6015131 2464887,6022024 2506800,6051618 2497264,6085637 2429709,6107065 2328604),(6024704 2346266,6018637 2338372,6022701 2330499,6031544 2337484,6024704 2346266)) +Style1-thinline;LINESTRING(6045939 2248058,6022024 2506800) diff --git a/doc/reference_measure.xml b/doc/reference_measure.xml index cbd2e6c8e..58f5f2b17 100644 --- a/doc/reference_measure.xml +++ b/doc/reference_measure.xml @@ -1521,7 +1521,7 @@ SELECT ST_AsText( Examples - + @@ -1567,32 +1567,44 @@ SELECT ST_AsText( LINESTRING(20 40,121.111404660392 186.629392246051) - - + + + + + + + + + + - longest straight distance to travel within an area + longest straight distance to travel from one part of city to the other. Note the max distance = to the length of the line. -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; +SELECT ST_AsText(ST_LongestLine(c.the_geom, c.the_geom)) As llinewkt +FROM (SELECT ST_GeomFromText( + 'POLYGON ((6107065 2328604, 6091208 2323033, +6092928 2305612, 6074587 2305837, 6074751 2268328, 6042817 2267620, +6045939 2248058, 6013411 2248863, 6029972 2264283, 5991220 2358173, + 6071023 2376046, 6015131 2464887, 6022024 2506800, 6051618 2497264, + 6085637 2429709, 6107065 2328604), + (6024704 2346266, 6018637 2338372, 6022701 2330499, + 6031544 2337484, 6024704 2346266))') As the_geom +) As c; - lline ------------------ -LINESTRING(20 40,121.111404660392 186.629392246051) + llinewkt | max_dist | len_lline + +--------------------------------------------+------------------+--------------- +LINESTRING(6045939 2248058,6022024 2506800) | 259844.857153264 | 259844.857153264 - - - + + + -- 2.50.1