Package com.vividsolutions.jump.io
Class GMLWriter
- java.lang.Object
-
- com.vividsolutions.jump.io.GMLWriter
-
- All Implemented Interfaces:
JUMPWriter,TaskMonitorSupport
- Direct Known Subclasses:
JMLWriter
public class GMLWriter extends Object implements JUMPWriter, TaskMonitorSupport
GMLWriter is aJUMPWriterspecialized to output GML. TODO: use a proper XML framework, switch to XML1.1 which supports much broader range of unicode charactersDataProperties for the JCSWriter write(featureSchema,DataProperties) interface:
Parameter Meaning OutputFile or DefaultValue File name for output .xml file OutputTemplateFile File name for GMLOutputTemplate file
NOTE: If OutputTemplateFile is unspecified, one will be auto-created (the JCS format).
Programmer details:
This is usually called as follows:
gmlWriter= new GMLWriter(); gmlWriter.write( DriverProperites);or:gmlWriter.setOutputTemplate( GMLOutputTemplate); gmlWriter.write( <writer>, <stream name>);
Also, the function "makeOutputTemplate()" is useful for autogenerating the JCS outputtemplate.
Output will be formed from the OutputTeplate like:
headerText ==== This section repeated for each feature featureText[0] <evaluate codeText[0]> featureText[1] <evaluate codeText[1]> ... featureTextFooter ==== footerText
-
-
Constructor Summary
Constructors Constructor Description GMLWriter()constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Stringformat(Date date)TaskMonitorgetTaskMonitor()voidsetTaskMonitor(TaskMonitor taskMonitor)protected StringtoString(Feature f, String column)voidwrite(FeatureCollection featureCollection, DriverProperties dp)Main entry function - write the GML file.voidwrite(FeatureCollection featureCollection, Writer writer)Actual evaluator/writer - you should have already called setOutputTemplate
-
-
-
Method Detail
-
write
public void write(FeatureCollection featureCollection, DriverProperties dp) throws Exception
Main entry function - write the GML file.- Specified by:
writein interfaceJUMPWriter- Parameters:
featureCollection- features to writedp- specify the 'OuputFile' and 'OuputTemplateFile'- Throws:
Exception
-
write
public void write(FeatureCollection featureCollection, Writer writer) throws Exception
Actual evaluator/writer - you should have already called setOutputTemplate- Parameters:
featureCollection- features to writewriter- - where to send the output to- Throws:
Exception
-
setTaskMonitor
public void setTaskMonitor(TaskMonitor taskMonitor)
- Specified by:
setTaskMonitorin interfaceTaskMonitorSupport
-
getTaskMonitor
public TaskMonitor getTaskMonitor()
- Specified by:
getTaskMonitorin interfaceTaskMonitorSupport
-
-