[mapserver-users] OGR/GeoJSON WRITE_BBOX

Rahkonen Jukka (Tike) jukka.rahkonen at mmmtike.fi
Mon Jun 30 09:47:04 PDT 2014


Hi,

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

ogr2ogr -f geojson test.json -lco WRITE_BBOX=YES "http://demo.opengeo.org/geoserver/wfs?service=wfs&version=1.0.0&request=getfeature&typename=og:archsites&outputformat=application/json"

See the beginning of the result

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::26713" } },
"bbox": [ 589860.0, 4914479.0, 608355.0, 4926490.0 ],
"features": [

Conclusion: ogr2ogr can do it. My version is GDAL 2.0-dev.

-Jukka Rahkonen-
________________________________
Tom wrote:

Hi folks,

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:

OUTPUTFORMAT
                  NAME "GEOJSON"
                  DRIVER "OGR/GeoJSON"
                  MIMETYPE "application/json; subtype=geojson"
                  FORMATOPTION "STORAGE=memory"
                  FORMATOPTION "FORM=SIMPLE"
                FORMATOPTION "LCO:WRITE_BBOX=YES"
END

According to http://www.gdal.org/drv_geojson.html, 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.

Does anyone have experience with this?  Any idea how I could determine if this would be a Mapserver issue, or an OGR issue?

Thanks,

Tom



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140630/05ae9bf9/attachment.html>


More information about the mapserver-users mailing list