com.vividsolutions.jump.io
Class GMLWriter

java.lang.Object
  extended by com.vividsolutions.jump.io.GMLWriter
All Implemented Interfaces:
JUMPWriter

public class GMLWriter
extends java.lang.Object
implements JUMPWriter

GMLWriter is a JUMPWriter specialized to output GML.

DataProperties for the JCSWriter write(featureSchema,DataProperties) interface:

ParameterMeaning
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
static java.lang.String standard_feature
           
static java.lang.String standard_featureCollection
           
static java.lang.String standard_geom
           
 
Constructor Summary
GMLWriter()
          constructor
 
Method Summary
static java.lang.String makeInputTemplate(FeatureSchema fcmd)
          given a FeatureSchema, make a chunk of XML that represents a valid GMLInputTemplate for the JCS format.
static GMLOutputTemplate makeOutputTemplate(FeatureSchema fcmd)
          given a FEatureSchema, make an output template in the JCS format
static java.lang.String safeXML(java.lang.String s)
          Convert an arbitary string into something that will not cause XML to gack.
 void setOutputTemplate(GMLOutputTemplate ot)
          Attaches a GMLOuputTemplate
 void write(FeatureCollection featureCollection, DriverProperties dp)
          Main entry function - write the GML file.
 void write(FeatureCollection featureCollection, java.io.Writer writer)
          Actual evaluator/writer - you should have already called setOutputTemplate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

standard_geom

public static java.lang.String standard_geom

standard_feature

public static java.lang.String standard_feature

standard_featureCollection

public static java.lang.String standard_featureCollection
Constructor Detail

GMLWriter

public GMLWriter()
constructor

Method Detail

write

public void write(FeatureCollection featureCollection,
                  DriverProperties dp)
           throws IllegalParametersException,
                  java.lang.Exception
Main entry function - write the GML file.

Specified by:
write in interface JUMPWriter
Parameters:
featureCollection - features to write
dp - specify the 'OuputFile' and 'OuputTemplateFile'
Throws:
IllegalParametersException
java.lang.Exception

write

public void write(FeatureCollection featureCollection,
                  java.io.Writer writer)
           throws java.lang.Exception
Actual evaluator/writer - you should have already called setOutputTemplate

Parameters:
featureCollection - features to write
writer - - where to send the output to
Throws:
java.lang.Exception

safeXML

public static java.lang.String safeXML(java.lang.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 java.lang.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