ogr2ogr for new WFS output formats
----------------------------------
Key: GEOS-665
URL: http://jira.codehaus.org/browse/GEOS-665
Project: GeoServer
Issue Type: New Feature
Components: WFS
Reporter: Chris Holmes
Assigned To: dblasby
Fix For: 1.4.0
Attachments: ogrout.zip
Duncan Clarkson has done some work to make use of ogr2ogr on our shapefile output to allow GeoServer to produce a variety of formats from its WFS. This is not quite the ideal way, using OGR's bindings directly should be the eventual solution. But it can likely build upon this code, and this code could make a nice community module. From Duncan:
I wouldn't necessarily say this is the best solution but it works. I
have since found out that OGR has Java bindings and this is probably the
way to go rather than calling the ogr2ogr binary. The other problem I
had was the SRS. In this implementation it's hard coded to suit our
needs but this is clearly inflexible. For the purposes of re-projection
there needs to be some way for the client to specify source and
destination SRS values.In order to get this lot to work you will need to specify the system
property ogr2ogr home, the path to OGR binary. I do this in catalina.sh
as part of Tomcat startup:-Dogr2ogr.home="/home/dnc/tmp/gdal/bin/ogr2ogr"
You should then be able to request the different formats using:
blah...blah...&outputFormat="KML2"&
The available formats are "CSV", "KML2" and "MIFMID" plus the Geoserver
standard formats of "GML" and "SHAPE-ZIP". If I recall correctly CSV and
MIFMID return a zip archive and KML is text.I've integrated this code successfully in the 1.3.1 branch but I've had
problems getting it to work in 1.3.2 - I get empty zip archives back or
incomplete XML documents. It maybe a problem with input/output streams
but I haven't had time to look into it. Any insight you have on this
would be great.At the moment I'm not doing any further work on this code but I will
re-visit it to add DXF support and perhaps to look at the Java bindings.
If you have any questions or comments please get in touch.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira