-Style2;POLYGON((122.1413 46.57208,121.82416 46.46066,121.85856 46.11224,121.49174 46.11674,121.49502 45.36656,120.85634 45.3524,120.91878 44.96116,120.26822 44.97726,120.59944 45.28566,119.8244 47.16346,121.42046 47.52092,120.30262 49.29774,120.44048 50.136,121.03236 49.94528,121.71274 48.59418,122.1413 46.57208),(120.49408 46.92532,120.37274 46.76744,120.45402 46.60998,120.63088 46.74968,120.49408 46.92532))
-Style1-thinline;LINESTRING(120.91878 44.96116,120.44048 50.136)
+Style2;GEOMETRYCOLLECTION(POLYGON((76 20.7142857142857,79 22,91 50,83.5 67.5,101 60,129 72,130.285714285714 75,141 50,129 22,101 10,76 20.7142857142857)),POLYGON((80.2857142857143 75,83.5 67.5,76 70.7142857142857,79 72,80.2857142857143 75)),POLYGON((83.5 82.5,80.2857142857143 75,79 78,76 79.2857142857143,83.5 82.5)),POLYGON((130.285714285714 75,129 78,101 90,83.5 82.5,91 100,83.5 117.5,101 110,129 122,130.285714285714 125,141 100,130.285714285714 75)),POLYGON((80.2857142857143 125,83.5 117.5,76 120.714285714286,79 122,80.2857142857143 125)),POLYGON((83.5 132.5,80.2857142857143 125,79 128,76 129.285714285714,83.5 132.5)),POLYGON((130.285714285714 125,129 128,101 140,83.5 132.5,91 150,79 178,76 179.285714285714,101 190,129 178,141 150,130.285714285714 125)),POLYGON((76 20.7142857142857,51 10,23 22,11 50,21.7142857142857 75,23 72,51 60,68.5 67.5,61 50,73 22,76 20.7142857142857)),POLYGON((76 70.7142857142857,68.5 67.5,71.7142857142857 75,73 72,76 70.7142857142857)),POLYGON((76 79.2857142857143,73 78,71.7142857142857 75,68.5 82.5,76 79.2857142857143)),POLYGON((68.5 82.5,51 90,23 78,21.7142857142857 75,11 100,21.7142857142857 125,23 122,51 110,68.5 117.5,61 100,68.5 82.5)),POLYGON((76 120.714285714286,68.5 117.5,71.7142857142857 125,73 122,76 120.714285714286)),POLYGON((76 129.285714285714,73 128,71.7142857142857 125,68.5 132.5,76 129.285714285714)),POLYGON((68.5 132.5,51 140,23 128,21.7142857142857 125,11 150,23 178,51 190,76 179.285714285714,73 178,61 150,68.5 132.5)))
+Style1-thinline;LINESTRING(23 22,129 178)
<imageobject>
<imagedata fileref="images/st_longestline03.png" />
</imageobject>
- <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>
+ <caption><para>longest straight distance to travel from one part of an elegant city to the other
+ Note the max distance = to the length of the line.</para></caption>
</mediaobject>
</informalfigure>
<programlisting>
SELECT ST_AsText(ST_LongestLine(c.the_geom, c.the_geom)) As llinewkt,
ST_MaxDistance(c.the_geom,c.the_geom) As max_dist,
- ST_Length(ST_LongestLine(c.the_geom, c.the_geom)) As lenll
-FROM (SELECT ST_GeomFromText(
- 'POLYGON((122.1413 46.57208,121.82416 46.46066,121.85856 46.11224,121.49174 46.11674,
- 121.49502 45.36656,120.85634 45.3524,120.91878 44.96116,
- 120.26822 44.97726,120.59944 45.28566,119.8244 47.16346,
- 121.42046 47.52092,120.30262 49.29774,120.44048 50.136,
- 121.03236 49.94528,121.71274 48.59418,122.1413 46.57208),
- (120.49408 46.92532,120.37274 46.76744,120.45402 46.60998,
- 120.63088 46.74968,120.49408 46.92532))') As the_geom
+ ST_Length(ST_LongestLine(c.the_geom, c.the_geom)) As lenll
+FROM (SELECT ST_BuildArea(ST_Collect(the_geom)) As the_geom
+ FROM (SELECT ST_Translate(ST_SnapToGrid(ST_Buffer(ST_Point(50 ,generate_series(50,190, 50)
+ ),40, 'quad_segs=2'),1), x, 0) As the_geom
+ FROM generate_series(1,100,50) As x) AS foo
) As c;
- llinewkt | max_dist | len_lline
------------------------------------------------- +------------------+---------------
- LINESTRING(120.91878 44.96116,120.44048 50.136) | 5.19689714306528 | 5.19689714306528
+ llinewkt | max_dist | lenll
+---------------------------+------------------+------------------
+ LINESTRING(23 22,129 178) | 188.605408193933 | 188.605408193933
</programlisting>
</para></entry>
</row>