Class GMLOutputTemplate
java.lang.Object
com.vividsolutions.jump.io.GMLOutputTemplate
This class provides a parser for reading GMLOuputTemplates. This does NOT contain an evaluator for
taking the parsed GMLOutputTemplate and a featureCollection and producing properly
formatted output GML. Thats the
Most people will just use the load() function, but there is support for directly
constructing/modifying one. Your best bet for hand creating one is to make a String that
contains a GMLOutputTemplate then make a java.io.StringReader and passing it to the load()
method.
The valuators (things that look like "<%") are:
<%=GEOMETRY> - replace this with a GML represention of the geometry
<%=COLUMN <column name>> - replace this with the corresponding JCS column value
<%FEATURE> - this marks the start of a feature in the OutputTemplate
<%ENDFEATURE> - This marks the end of a feature in the OutputTempalte
Here's an example of how a simple GMLOutputTemplate is parsed by this class: for input like:
<?xml version='1.0' encoding='UTF-8'?>
<dataset...>
<schemaFeatures>
<gml:featureMember>
<% FEATURE %>
<Feature>
<featureType> <%=COLUMN featureType %> </featureType>
<property fme:name="ID"> <%=COLUMN ID %> </property>
<property fme:name="SITE"> <%=COLUMN SITE %> </property>
<property fme:name="gml2_coordsys"></property>
<gml:pointProperty>
<%=GEOMETRY %>
</gml:pointProperty>
</Feature>
<% ENDFEATURE %>
</gml:featureMember>
</dataFeatures>
</dataset>
headeText =
<?xml version='1.0' encoding='UTF-8'?>
<dataset...>
<schemaFeatures>
<gml:featureMember>
footerText =
</gml:featureMember>
</dataFeatures>
</dataset>
featureText[0] =
<Feature>
<featureType>
codingText[0] = "=COLUMN featureTtype"
featureText[1] =
</property>
<property fme:name="SITE">
codingText[1] = "=COLUMN ID"
taking the parsed GMLOutputTemplate and a featureCollection and producing properly
formatted output GML. Thats the
GMLWriter class.Most people will just use the load() function, but there is support for directly
constructing/modifying one. Your best bet for hand creating one is to make a String that
contains a GMLOutputTemplate then make a java.io.StringReader and passing it to the load()
method.
The valuators (things that look like "<%") are:
<%=GEOMETRY> - replace this with a GML represention of the geometry
<%=COLUMN <column name>> - replace this with the corresponding JCS column value
<%FEATURE> - this marks the start of a feature in the OutputTemplate
<%ENDFEATURE> - This marks the end of a feature in the OutputTempalte
Here's an example of how a simple GMLOutputTemplate is parsed by this class: for input like:
<?xml version='1.0' encoding='UTF-8'?>
<dataset...>
<schemaFeatures>
<gml:featureMember>
<% FEATURE %>
<Feature>
<featureType> <%=COLUMN featureType %> </featureType>
<property fme:name="ID"> <%=COLUMN ID %> </property>
<property fme:name="SITE"> <%=COLUMN SITE %> </property>
<property fme:name="gml2_coordsys"></property>
<gml:pointProperty>
<%=GEOMETRY %>
</gml:pointProperty>
</Feature>
<% ENDFEATURE %>
</gml:featureMember>
</dataFeatures>
</dataset>
headeText =
<?xml version='1.0' encoding='UTF-8'?>
<dataset...>
<schemaFeatures>
<gml:featureMember>
footerText =
</gml:featureMember>
</dataFeatures>
</dataset>
featureText[0] =
<Feature>
<featureType>
codingText[0] = "=COLUMN featureTtype"
featureText[1] =
</property>
<property fme:name="SITE">
codingText[1] = "=COLUMN ID"
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfor input like :
<feature> <PROPERTY type=name> <%=NAME></property> <PROPERTY type=address> <%=ADDRESS> </property>
use addItem("<feature> <PROPERTY type=name>","=NAME")
addItem("</property> <PROPERTY type=address>", "%=ADDRESS")asString()For debugging - return a human readable version of the parsed outputtemplatevoidCalls the main load() method with the stream name as "Unknown Stream"voidMain function - parse a GMLOuputTemplate.
-
Constructor Details
-
GMLOutputTemplate
public GMLOutputTemplate()constructor
-
-
Method Details
-
addItem
-
load
-
load
-
asString
For debugging - return a human readable version of the parsed outputtemplate
-