This refers to the documentation whose main page is : <a href="http://postgis.refractions.net/docs/index.html">http://postgis.refractions.net/docs/index.html</a><br><br>I've been experimenting with getting geometry in different formats.<br>
<br>On this page: <a href="http://postgis.refractions.net/docs/ST_AsGeoJSON.html">http://postgis.refractions.net/docs/ST_AsGeoJSON.html</a> it is possible to get a dictionary like object that includes an object bounding box.  I like this.<br>
<br>However I am not getting the results set out in the doc.  Unless I'm missing something, either the function is wrong, or the docs are wrong.<br><br>We are discussing the fourth parameter in the call ST_AsGeoJSON()  The documentation says that if 1 is set, a bbox is returned, it is not.  a bbox is included if 2 is set.  Other option values appear to have no effect.  (see docs)<br>
<br>---<br><br>case where options = 1 <br><br style="font-family: courier new,monospace;"><b><span style="font-family: courier new,monospace;">euclid=# SELECT id, etype, ST_AsGeoJSON( 1, the_geom, 1, 1 ) FROM gis_geometry WHERE id = 1571;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  id  |  etype   |                                                                                                                   st_asgeojson                                                                                                                   </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">------+----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> 1571 | polyline | {"type":"MultiLineString","coordinates":[[[153.9,883.2],[246.6,812.8],[247.3,807.4],[243.5,801.7],[227.0,776.8],[225.9,771.4],[226.6,766.1],[238.1,711.7],[238.9,707.1],[241.2,702.1],[244.6,695.6],[246.9,692.2],[251.5,688.7],[546.5,472.7]]]}</span></b><br style="font-family: courier new,monospace;">
<br>case where options = 2<br><br><b style="font-family: courier new,monospace;">euclid=# SELECT id, etype, ST_AsGeoJSON( 1, the_geom, 1, 2 ) FROM gis_geometry WHERE id = 1571;<br><br>  id  |  etype   |                                                                                                                                   st_asgeojson                                                                                                                                    <br>
------+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
 1571 | polyline | {"type":"MultiLineString","bbox":[153.9,472.7,546.5,883.2],"coordinates":[[[153.9,883.2],[246.6,812.8],[247.3,807.4],[243.5,801.7],[227.0,776.8],[225.9,771.4],[226.6,766.1],[238.1,711.7],[238.9,707.1],[241.2,702.1],[244.6,695.6],[246.9,692.2],[251.5,688.7],[546.5,472.7]]]}<br>
(1 row)<br></b><br><br><br>-- <br>Cheers!<br>Rick<br>