tapple
June 18, 2008, 4:21pm
1
Any update to these instructions for creating new output
formats in WFS - don't see that these classes/interfaces exist in
the trunk source code:
http://geoserver.org/display/GEOSDOC/Create+your+own+Output+Format
Thanks,
Todd
--
View this message in context: http://www.nabble.com/developing-new-wfs-output-formats-tp17986265p17986265.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.
Hi Todd,
My apologies, that page is sorely out of date for GeoServer 1.6.x and trunk. I will mark it as so.
The way currently to implement a WFS output format is to extend the class org.geoserver.wfs.WFSGetFeatureOutputFormat. Something like the following:
class MyOutputFormat extends WFSGetFeatureOutputFormat {
public MyOutputFormat() {
super( "foo" );
// this is the string used to identify the format in a request
// example: '&outputFormat=foo'
}
public String getMimeType(Object value, Operation operation)
throws ServiceException {
//return the mime type of your format
}
protected abstract void write(
FeatureCollectionType featureCollection,
OutputStream output, Operation getFeature) throws IOException, ServiceException;
//write to output stream
}
}
After that you need to register your output format in a spring 'applicationContext.xml' file. Like this:
<beans>
<bean id="myOutputFormat" class="MyOutputFormat"/>
</beans>
Hope that helps. If you have any problems at all or anything is unclear please feel free to ask more questions.
-Justin
todd-ncar wrote:
Any update to these instructions for creating new output
formats in WFS - don't see that these classes/interfaces exist in the trunk source code:
http://geoserver.org/display/GEOSDOC/Create+your+own+Output+Format
Thanks,
Todd
--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com
tapple
June 19, 2008, 3:20pm
3
How are you handling/compiling the schema( xsd ). I've used XMLBeans
in the past and then referenced the compiled classes. Is there a standard
in Geoserver Dev for how the output is mapped to the schema.
Thanks
todd-ncar wrote:
Any update to these instructions for creating new output
formats in WFS - don't see that these classes/interfaces exist in
the trunk source code:
http://geoserver.org/display/GEOSDOC/Create+your+own+Output+Format
Thanks,
Todd
--
View this message in context: http://www.nabble.com/developing-new-wfs-output-formats-tp17986265p18011300.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.