Class GMLWriter

  • All Implemented Interfaces:
    JUMPWriter

    public class GMLWriter
    extends 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 Detail

      • standard_geom

        public static String standard_geom
      • standard_feature

        public static String standard_feature
      • standard_featureCollection

        public static String standard_featureCollection
    • Constructor Detail

      • GMLWriter

        public GMLWriter()
        constructor
    • Method Detail

      • write

        public void write​(FeatureCollection featureCollection,
                          Writer writer)
                   throws Exception
        Actual evaluator/writer - you should have already called setOutputTemplate
        Parameters:
        featureCollection - features to write
        writer - - 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