]> granicus.if.org Git - postgis/commitdiff
another st_longestline example
authorRegina Obe <lr@pcorp.us>
Thu, 26 Nov 2009 18:50:03 +0000 (18:50 +0000)
committerRegina Obe <lr@pcorp.us>
Thu, 26 Nov 2009 18:50:03 +0000 (18:50 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4907 b70326c6-7e19-0410-871a-916f4a2858ee

doc/html/image_src/Makefile.in
doc/html/image_src/st_longestline03.wkt [new file with mode: 0644]
doc/reference_measure.xml

index e3e907259ba584e3e07d7b7f7667edc04a38c101..e0abf824cea9eeea09d1e4f5b873c7625e526ddc 100644 (file)
@@ -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 (file)
index 0000000..ec35e4d
--- /dev/null
@@ -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)
index cbd2e6c8e016a24b4c5b9e6eb5b9e8a8dbad800b..58f5f2b173de3d8528cff8c88b7b75bf92aba826 100644 (file)
@@ -1521,7 +1521,7 @@ SELECT ST_AsText(
          <refsection>
                <title>Examples</title>
                        <informaltable>
-                                 <tgroup cols="3">
+                                 <tgroup cols="2">
                                        <tbody>
                                          <row>
                                                <entry><para><informalfigure>
@@ -1567,32 +1567,44 @@ SELECT ST_AsText(
 LINESTRING(20 40,121.111404660392 186.629392246051)
                                </programlisting>
                                                </para></entry>
-                                               
-                                               <entry><para><informalfigure>
+                                         </row>
+               </tbody>
+       </tgroup>
+</informaltable>
+
+<informaltable>
+         <tgroup cols="1">
+               <tbody>
+                 <row>                                         
+                       <entry><para><informalfigure>
                                                        <mediaobject>
                                                          <imageobject>
                                                                <imagedata fileref="images/st_longestline03.png" />
                                                          </imageobject>
-                                                         <caption><para>longest straight distance to travel within an area</para></caption>
+                                                         <caption><para>longest straight distance to travel from one part of city to the other.  Note the max distance = to the length of the line.</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;
+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
                                </programlisting>
                                                </para></entry>
-                                         </row>
-               </tbody>
-       </tgroup>
+               </row>
+       </tbody>
+</tgroup>
 </informaltable>
          </refsection>