<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.emailstyle17
{mso-style-name:emailstyle17;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.balloontextchar0
{mso-style-name:balloontextchar;
font-family:"Tahoma","sans-serif";}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Thanks, Jukka. I see that Geoserver is including the FeatureCollection bbox, but my GeoJSON from Mapserver is not. If I take the json from my WFS call and run it through ogr2ogr as you suggested, the output is an exact copy of the original. I still get bbox for the individual features, but not the feature collection. I tried GDAL 1.9 and 2.0-dev. Perhaps there is something missing from my layer configuration, or could it be that Geoserver has this capability but Mapserver does not?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> mapserver-users-bounces@lists.osgeo.org [mailto:mapserver-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Rahkonen Jukka (Tike)<br><b>Sent:</b> Monday, June 30, 2014 12:47 PM<br><b>To:</b> Tom; mapserver-users@lists.osgeo.org<br><b>Subject:</b> Re: [mapserver-users] OGR/GeoJSON WRITE_BBOX<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>Hi,<br><br>About how to test if it is an OGR issue, make a test with OGR. Capture some data for example from some Geoserver WFS and convert it into geojson with ogr2ogr<br><br>ogr2ogr -f geojson test.json -lco WRITE_BBOX=YES "<a href="http://demo.opengeo.org/geoserver/wfs?service=wfs&version=1.0.0&request=getfeature&typename=og:archsites&outputformat=application/json">http://demo.opengeo.org/geoserver/wfs?service=wfs&version=1.0.0&request=getfeature&typename=og:archsites&outputformat=application/json</a>"<br><br>See the beginning of the result<br><br>{<br>"type": "FeatureCollection",<br>"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::26713" } },<br>"bbox": [ 589860.0, 4914479.0, 608355.0, 4926490.0 ],<br>"features": [<br><br>Conclusion: ogr2ogr can do it. My version is GDAL 2.0-dev.<br><br>-Jukka Rahkonen-<o:p></o:p></span></p><div><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'><hr size=2 width="100%" align=center></span></div><div id=divRpF485086><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>Tom wrote:</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'><o:p></o:p></span></p></div><div><div><p class=MsoNormal><span style='color:#1F497D'>Hi folks,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I’m trying to use OGR to output GeoJSON from my WFS service. I’d like to include the BBOX (equivalent of gml:boundedBy) at the FeatureCollection level. From the documentation, it looks like I should be able to set it up this way:</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>OUTPUTFORMAT</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> NAME "GEOJSON"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> DRIVER "OGR/GeoJSON"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> MIMETYPE "application/json; subtype=geojson"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> FORMATOPTION "STORAGE=memory"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> FORMATOPTION "FORM=SIMPLE"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> FORMATOPTION "LCO:WRITE_BBOX=YES"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>END</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>According to <a href="http://www.gdal.org/drv_geojson.html" target="_blank">http://www.gdal.org/drv_geojson.html</a>, WRITE_BBOX is exactly what I need. According to the docs, it should create a bbox at the FeatureCollection and the Feature level. For me, it generates a bbox for every feature, but not one for the top-level FeatureCollection, which OGR claims to support.</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Does anyone have experience with this? Any idea how I could determine if this would be a Mapserver issue, or an OGR issue?</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Tom</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p></div></div></div></div></div></body></html>