Package org.locationtech.jts.jump.io
Class GMLWriter
- java.lang.Object
-
- org.locationtech.jts.jump.io.GMLWriter
-
- All Implemented Interfaces:
JUMPWriter
public class GMLWriter extends Object implements JUMPWriter
GMLWriter is aJUMPWriterspecialized to output GML.DataProperties 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(, );
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
-
-
Field Summary
Fields Modifier and Type Field Description static Stringstandard_featurestatic Stringstandard_featureCollectionstatic Stringstandard_geom
-
Constructor Summary
Constructors Constructor Description GMLWriter()constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Stringformat(Date date)static StringmakeInputTemplate(FeatureSchema fcmd)given a FeatureSchema, make a chunk of XML that represents a valid GMLInputTemplate for the JCS format.static GMLOutputTemplatemakeOutputTemplate(FeatureSchema fcmd)given a FEatureSchema, make an output template in the JCS formatstatic StringsafeXML(String s)Convert an arbitary string into something that will not cause XML to gack.voidsetOutputTemplate(GMLOutputTemplate ot)Attaches a GMLOuputTemplateprotected StringtoString(Feature f, String column)voidwrite(FeatureCollection featureCollection, Writer writer)Actual evaluator/writer - you should have already called setOutputTemplatevoidwrite(FeatureCollection featureCollection, DriverProperties dp)Main entry function - write the GML file.
-
-
-
Method Detail
-
write
public void write(FeatureCollection featureCollection, DriverProperties dp) throws IllegalParametersException, Exception
Main entry function - write the GML file.- Specified by:
writein interfaceJUMPWriter- Parameters:
featureCollection- features to writedp- specify the 'OuputFile' and 'OuputTemplateFile'- Throws:
IllegalParametersExceptionException
-
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
-
safeXML
public static String safeXML(String s)
Convert an arbitary string into something that will not cause XML to gack. Ie. convert "<" to "<"- Parameters:
s- string to safe-ify
-
setOutputTemplate
public void setOutputTemplate(GMLOutputTemplate ot)
Attaches a GMLOuputTemplate
-
makeOutputTemplate
public static GMLOutputTemplate makeOutputTemplate(FeatureSchema fcmd)
given a FEatureSchema, make an output template in the JCS format- Parameters:
fcmd- input featureSchema
-
makeInputTemplate
public static String makeInputTemplate(FeatureSchema fcmd)
given a FeatureSchema, make a chunk of XML that represents a valid GMLInputTemplate for the JCS format. Used by makeOutputTemplate since the output template includes an inputtemplate.- Parameters:
fcmd- the featureSchema to describe
-
-