|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.feature.FeatureTypes
Utility methods for working against the FeatureType interface.
Many methods from DataUtilities should be refractored here.
Responsibilities:
| Field Summary | |
static int |
ANY_LENGTH
represent an unbounded field length |
| Constructor Summary | |
FeatureTypes()
|
|
| Method Summary | |
static java.util.Set |
ancestors(FeatureType featureType)
|
static boolean |
equals(AttributeType[] attributesA,
AttributeType[] attributesB)
|
static boolean |
equals(AttributeType a,
AttributeType b)
|
static boolean |
equals(FeatureType typeA,
FeatureType typeB)
Exact equality based on typeNames, namespace, attributes and ancestors |
static boolean |
equalsAncestors(FeatureType typeA,
FeatureType typeB)
This method depends on the correct implementation of FeatureType equals We may need to write an implementation that can detect cycles, |
static boolean |
equalsId(FeatureType typeA,
FeatureType typeB)
Quick check of namespace and typename |
static int |
getFieldLength(AttributeType type)
This is a 'suitable replacement for extracting the expected field length of an attribute absed on its "facets" (ie Filter describing type restrictions); This code is copied from the ShapefileDataStore where it was written (probably by dzwiers). |
static boolean |
isDecendedFrom(FeatureType featureType,
FeatureType isParentType)
|
static boolean |
isDecendedFrom(FeatureType featureType,
java.net.URI namespace,
java.lang.String typeName)
A query of the the types ancestor information. |
static FeatureType |
newFeatureType(AttributeType[] types,
java.lang.String name)
Create a new FeatureType with the given AttributeTypes. |
static FeatureType |
newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns)
Create a new FeatureType with the given AttributeTypes. |
static FeatureType |
newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns,
boolean isAbstract)
Create a new FeatureType with the given AttributeTypes. |
static FeatureType |
newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns,
boolean isAbstract,
FeatureType[] superTypes)
The most specific way to create a new FeatureType. |
static FeatureType |
newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns,
boolean isAbstract,
FeatureType[] superTypes,
AttributeType defaultGeometry)
The most specific way to create a new FeatureType. |
static FeatureType |
newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns,
boolean isAbstract,
FeatureType[] superTypes,
GeometryAttributeType defaultGeometry)
The most specific way to create a new FeatureType. |
static Feature |
transform(Feature feature,
FeatureType schema,
org.opengis.referencing.operation.MathTransform transform)
Applies transform to all geometry attribute. |
static FeatureType |
transform(FeatureType schema,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ANY_LENGTH
| Constructor Detail |
public FeatureTypes()
| Method Detail |
public static int getFieldLength(AttributeType type)
This code is copied from the ShapefileDataStore where it was written (probably by dzwiers). Cholmes is providing documentation.
public static FeatureType transform(FeatureType schema,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
throws SchemaException
SchemaException
public static Feature transform(Feature feature,
FeatureType schema,
org.opengis.referencing.operation.MathTransform transform)
throws org.opengis.spatialschema.geometry.MismatchedDimensionException,
org.opengis.referencing.operation.TransformException,
IllegalAttributeException
feature - Feature to be transformedschema - Schema for target transformation - transform( schema, crs )transform - MathTransform used to transform coordinates - reproject( crs, crs )
org.opengis.referencing.operation.TransformException
org.opengis.spatialschema.geometry.MismatchedDimensionException
IllegalAttributeException
public static FeatureType newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns,
boolean isAbstract,
FeatureType[] superTypes)
throws FactoryConfigurationError,
SchemaException
types - The AttributeTypes to create the FeatureType with.name - The typeName of the FeatureType. Required, may not be null.ns - The namespace of the FeatureType. Optional, may be null.isAbstract - True if this created type should be abstract.superTypes - A Collection of types the FeatureType will inherit from. Currently, all
types inherit from feature in the opengis namespace.
FactoryConfigurationError - If there are problems creating a factory.
SchemaException - If the AttributeTypes provided are invalid in some way.
public static FeatureType newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns,
boolean isAbstract,
FeatureType[] superTypes,
AttributeType defaultGeometry)
throws FactoryConfigurationError,
SchemaException
types - The AttributeTypes to create the FeatureType with.name - The typeName of the FeatureType. Required, may not be null.ns - The namespace of the FeatureType. Optional, may be null.isAbstract - True if this created type should be abstract.superTypes - A Collection of types the FeatureType will inherit from. Currently, all
types inherit from feature in the opengis namespace.
FactoryConfigurationError - If there are problems creating a factory.
SchemaException - If the AttributeTypes provided are invalid in some way.
public static FeatureType newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns,
boolean isAbstract,
FeatureType[] superTypes,
GeometryAttributeType defaultGeometry)
throws FactoryConfigurationError,
SchemaException
types - The AttributeTypes to create the FeatureType with.name - The typeName of the FeatureType. Required, may not be null.ns - The namespace of the FeatureType. Optional, may be null.isAbstract - True if this created type should be abstract.superTypes - A Collection of types the FeatureType will inherit from. Currently, all
types inherit from feature in the opengis namespace.
FactoryConfigurationError - If there are problems creating a factory.
SchemaException - If the AttributeTypes provided are invalid in some way.
public static FeatureType newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns,
boolean isAbstract)
throws FactoryConfigurationError,
SchemaException
newFeatureType(types,name,ns,isAbstract,null).
types - The AttributeTypes to create the FeatureType with.name - The typeName of the FeatureType. Required, may not be null.ns - The namespace of the FeatureType. Optional, may be null.isAbstract - True if this created type should be abstract.
FactoryConfigurationError - If there are problems creating a factory.
SchemaException - If the AttributeTypes provided are invalid in some way.
public static FeatureType newFeatureType(AttributeType[] types,
java.lang.String name,
java.net.URI ns)
throws FactoryConfigurationError,
SchemaException
newFeatureType(types,name,ns,false,null).
types - The AttributeTypes to create the FeatureType with.name - The typeName of the FeatureType. Required, may not be null.ns - The namespace of the FeatureType. Optional, may be null.
FactoryConfigurationError - If there are problems creating a factory.
SchemaException - If the AttributeTypes provided are invalid in some way.
public static FeatureType newFeatureType(AttributeType[] types,
java.lang.String name)
throws FactoryConfigurationError,
SchemaException
newFeatureType(types,name,null,false,null). Useful for test cases or
datasources which may not allow a namespace.
types - The AttributeTypes to create the FeatureType with.name - The typeName of the FeatureType. Required, may not be null.
FactoryConfigurationError - If there are problems creating a factory.
SchemaException - If the AttributeTypes provided are invalid in some way.
public static boolean isDecendedFrom(FeatureType featureType,
java.net.URI namespace,
java.lang.String typeName)
This utility method may be used as common implementation for
FeatureType.isDecendedFrom( namespace, typeName ), however for specific uses,
such as GML, an implementor may be able to provide a more efficient implemenation based on
prior knolwege.
This is a proper check, if the provided FeatureType matches the given namespace and typename it is not considered to be decended from itself.
featureType - typeName with parentage in questionnamespace - namespace to match against, or null for a "wildcard"typeName - typename to match against, or null for a "wildcard"
public static boolean isDecendedFrom(FeatureType featureType,
FeatureType isParentType)
public static boolean equals(FeatureType typeA,
FeatureType typeB)
public static boolean equals(AttributeType[] attributesA,
AttributeType[] attributesB)
public static boolean equalsAncestors(FeatureType typeA,
FeatureType typeB)
We may need to write an implementation that can detect cycles,
typeA - typeB -
public static java.util.Set ancestors(FeatureType featureType)
public static boolean equals(AttributeType a,
AttributeType b)
public static boolean equalsId(FeatureType typeA,
FeatureType typeB)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||