org.geotools.gml2.bindings
Class GML2ParsingUtils

java.lang.Object
  extended by org.geotools.gml2.bindings.GML2ParsingUtils

public class GML2ParsingUtils
extends java.lang.Object

Utility methods used by gml2 bindings when parsing.

Author:
Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org

Constructor Summary
GML2ParsingUtils()
           
 
Method Summary
static java.util.Collection asCollection(com.vividsolutions.jts.geom.GeometryCollection gc)
          Wraps the elements of a geometry collection in a normal collection.
static org.opengis.referencing.crs.CoordinateReferenceSystem crs(Node node)
           
static org.opengis.feature.simple.SimpleFeature feature(org.opengis.feature.simple.SimpleFeatureType fType, java.lang.String fid, Node node)
           
static org.opengis.feature.simple.SimpleFeatureType featureType(Node node)
          Turns a parse node instance into a geotools feature type.
static org.opengis.feature.simple.SimpleFeatureType featureType(org.eclipse.xsd.XSDElementDeclaration element, BindingWalkerFactory bwFactory)
          Turns a xml type definition into a geotools feature type.
static org.opengis.feature.simple.SimpleFeature parseFeature(ElementInstance instance, Node node, java.lang.Object value, FeatureTypeCache ftCache, BindingWalkerFactory bwFactory)
          Utility method to implement Binding.parse for a binding which parses into A feature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GML2ParsingUtils

public GML2ParsingUtils()
Method Detail

parseFeature

public static org.opengis.feature.simple.SimpleFeature parseFeature(ElementInstance instance,
                                                                    Node node,
                                                                    java.lang.Object value,
                                                                    FeatureTypeCache ftCache,
                                                                    BindingWalkerFactory bwFactory)
                                                             throws java.lang.Exception
Utility method to implement Binding.parse for a binding which parses into A feature.

Parameters:
instance - The instance being parsed.
node - The parse tree.
value - The value from the last binding in the chain.
ftCache - The feature type cache.
bwFactory - Binding walker factory.
Returns:
A feature type.
Throws:
java.lang.Exception

featureType

public static org.opengis.feature.simple.SimpleFeatureType featureType(Node node)
                                                                throws java.lang.Exception
Turns a parse node instance into a geotools feature type.

For each child element and attribute of the node a geotools attribute type is created. AttributeType#getName() is derived from the name of the child element / attribute. Attribute#getType() is derived from the class of the value of the child element / attribute.

Attribute types for the mandatory properties of any gml feature type (description,name,boundedBy) are also created.

Parameters:
node - The parse node / tree for the feature.
Returns:
A geotools feature type
Throws:
java.lang.Exception

featureType

public static org.opengis.feature.simple.SimpleFeatureType featureType(org.eclipse.xsd.XSDElementDeclaration element,
                                                                       BindingWalkerFactory bwFactory)
                                                                throws java.lang.Exception
Turns a xml type definition into a geotools feature type.

Parameters:
type - The xml schema tupe.
Returns:
The corresponding geotools feature type.
Throws:
java.lang.Exception

feature

public static org.opengis.feature.simple.SimpleFeature feature(org.opengis.feature.simple.SimpleFeatureType fType,
                                                               java.lang.String fid,
                                                               Node node)
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

crs

public static org.opengis.referencing.crs.CoordinateReferenceSystem crs(Node node)

asCollection

public static java.util.Collection asCollection(com.vividsolutions.jts.geom.GeometryCollection gc)
Wraps the elements of a geometry collection in a normal collection.



Copyright © 1996-2010 Geotools. All Rights Reserved.