| java.lang.Object org.geotools.feature.FeatureTypes
All known Subclasses: org.geotools.feature.FeatureTypeBuilder,
FeatureTypes | public class FeatureTypes (Code) | | Utility methods for working against the FeatureType interface.
Many methods from DataUtilities should be refractored here.
Responsibilities:
- Schema construction from String spec
- Schema Force CRS
author: Jody Garnett, Refractions Research since: 2.1.M3 |
Method Summary | |
public static Set | ancestors(FeatureType featureType) | public static boolean | equals(FeatureType typeA, FeatureType typeB) | public static boolean | equals(AttributeType attributesA, AttributeType attributesB) | public static boolean | equals(AttributeType a, AttributeType b) | public static boolean | equalsAncestors(FeatureType typeA, FeatureType typeB) | public static boolean | equalsId(FeatureType typeA, FeatureType typeB) | public 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). | public static boolean | isDecendedFrom(FeatureType featureType, URI namespace, String typeName) A query of the the types ancestor information. | public static boolean | isDecendedFrom(FeatureType featureType, FeatureType isParentType) | public static FeatureType | newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes) The most specific way to create a new FeatureType.
Parameters: types - The AttributeTypes to create the FeatureType with. Parameters: name - The typeName of the FeatureType. | public static FeatureType | newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes, AttributeType defaultGeometry) The most specific way to create a new FeatureType.
Parameters: types - The AttributeTypes to create the FeatureType with. Parameters: name - The typeName of the FeatureType. | public static FeatureType | newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes, GeometryAttributeType defaultGeometry) The most specific way to create a new FeatureType.
Parameters: types - The AttributeTypes to create the FeatureType with. Parameters: name - The typeName of the FeatureType. | public static FeatureType | newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract) Create a new FeatureType with the given AttributeTypes. | public static FeatureType | newFeatureType(AttributeType[] types, String name, URI ns) Create a new FeatureType with the given AttributeTypes. | public static FeatureType | newFeatureType(AttributeType[] types, String name) Create a new FeatureType with the given AttributeTypes. | public static FeatureType | transform(FeatureType schema, CoordinateReferenceSystem crs) | public static FeatureType | transform(FeatureType schema, CoordinateReferenceSystem crs, boolean forceOnlyMissing) Forces the specified CRS on geometry attributes (all or some, depends on the parameters). | public static Feature | transform(Feature feature, FeatureType schema, MathTransform transform) Applies transform to all geometry attribute. |
ANY_LENGTH | final public static int ANY_LENGTH(Code) | | represent an unbounded field length
|
DEFAULT_NAMESPACE | final public static URI DEFAULT_NAMESPACE(Code) | | the default namespace for feature types
|
equals | public static boolean equals(FeatureType typeA, FeatureType typeB)(Code) | | Exact equality based on typeNames, namespace, attributes and ancestors
|
equalsAncestors | public static boolean equalsAncestors(FeatureType typeA, FeatureType typeB)(Code) | | This method depends on the correct implementation of FeatureType equals
We may need to write an implementation that can detect cycles,
Parameters: typeA - Parameters: typeB - |
getFieldLength | public static int getFieldLength(AttributeType type)(Code) | | 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).
Cholmes is providing documentation.
Parameters: type - the AttributeType an int indicating the max length of field in characters, or ANY_LENGTH |
isDecendedFrom | public static boolean isDecendedFrom(FeatureType featureType, URI namespace, String typeName)(Code) | | A query of the the types ancestor information.
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.
Parameters: featureType - typeName with parentage in question Parameters: namespace - namespace to match against, or null for a "wildcard" Parameters: typeName - typename to match against, or null for a "wildcard" true if featureType is a decendent of the indicated namespace & typeName |
newFeatureType | public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes) throws FactoryConfigurationError, SchemaException(Code) | | The most specific way to create a new FeatureType.
Parameters: types - The AttributeTypes to create the FeatureType with. Parameters: name - The typeName of the FeatureType. Required, may not be null. Parameters: ns - The namespace of the FeatureType. Optional, may be null. Parameters: isAbstract - True if this created type should be abstract. Parameters: superTypes - A Collection of types the FeatureType will inherit from. Currently, alltypes inherit from feature in the opengis namespace. A new FeatureType created from the given arguments. throws: FactoryConfigurationError - If there are problems creating a factory. throws: SchemaException - If the AttributeTypes provided are invalid in some way. |
newFeatureType | public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes, AttributeType defaultGeometry) throws FactoryConfigurationError, SchemaException(Code) | | The most specific way to create a new FeatureType.
Parameters: types - The AttributeTypes to create the FeatureType with. Parameters: name - The typeName of the FeatureType. Required, may not be null. Parameters: ns - The namespace of the FeatureType. Optional, may be null. Parameters: isAbstract - True if this created type should be abstract. Parameters: superTypes - A Collection of types the FeatureType will inherit from. Currently, alltypes inherit from feature in the opengis namespace. A new FeatureType created from the given arguments. throws: FactoryConfigurationError - If there are problems creating a factory. throws: SchemaException - If the AttributeTypes provided are invalid in some way. |
newFeatureType | public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes, GeometryAttributeType defaultGeometry) throws FactoryConfigurationError, SchemaException(Code) | | The most specific way to create a new FeatureType.
Parameters: types - The AttributeTypes to create the FeatureType with. Parameters: name - The typeName of the FeatureType. Required, may not be null. Parameters: ns - The namespace of the FeatureType. Optional, may be null. Parameters: isAbstract - True if this created type should be abstract. Parameters: superTypes - A Collection of types the FeatureType will inherit from. Currently, alltypes inherit from feature in the opengis namespace. A new FeatureType created from the given arguments. throws: FactoryConfigurationError - If there are problems creating a factory. throws: SchemaException - If the AttributeTypes provided are invalid in some way. |
newFeatureType | public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract) throws FactoryConfigurationError, SchemaException(Code) | | Create a new FeatureType with the given AttributeTypes. A short cut for calling
newFeatureType(types,name,ns,isAbstract,null) .
Parameters: types - The AttributeTypes to create the FeatureType with. Parameters: name - The typeName of the FeatureType. Required, may not be null. Parameters: ns - The namespace of the FeatureType. Optional, may be null. Parameters: isAbstract - True if this created type should be abstract. A new FeatureType created from the given arguments. throws: FactoryConfigurationError - If there are problems creating a factory. throws: SchemaException - If the AttributeTypes provided are invalid in some way. |
newFeatureType | public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns) throws FactoryConfigurationError, SchemaException(Code) | | Create a new FeatureType with the given AttributeTypes. A short cut for calling
newFeatureType(types,name,ns,false,null) .
Parameters: types - The AttributeTypes to create the FeatureType with. Parameters: name - The typeName of the FeatureType. Required, may not be null. Parameters: ns - The namespace of the FeatureType. Optional, may be null. A new FeatureType created from the given arguments. throws: FactoryConfigurationError - If there are problems creating a factory. throws: SchemaException - If the AttributeTypes provided are invalid in some way. |
newFeatureType | public static FeatureType newFeatureType(AttributeType[] types, String name) throws FactoryConfigurationError, SchemaException(Code) | | Create a new FeatureType with the given AttributeTypes. A short cut for calling
newFeatureType(types,name,null,false,null) . Useful for test cases or
datasources which may not allow a namespace.
Parameters: types - The AttributeTypes to create the FeatureType with. Parameters: name - The typeName of the FeatureType. Required, may not be null. A new FeatureType created from the given arguments. throws: FactoryConfigurationError - If there are problems creating a factory. throws: SchemaException - If the AttributeTypes provided are invalid in some way. |
transform | public static FeatureType transform(FeatureType schema, CoordinateReferenceSystem crs, boolean forceOnlyMissing) throws SchemaException(Code) | | Forces the specified CRS on geometry attributes (all or some, depends on the parameters).
Parameters: schema - the original schema Parameters: crs - the forced crs Parameters: forceOnlyMissing - if true, will force the specified crs only on the attributes that do miss one throws: SchemaException - |
transform | public static Feature transform(Feature feature, FeatureType schema, MathTransform transform) throws MismatchedDimensionException, TransformException, IllegalAttributeException(Code) | | Applies transform to all geometry attribute.
Parameters: feature - Feature to be transformed Parameters: schema - Schema for target transformation - transform( schema, crs ) Parameters: transform - MathTransform used to transform coordinates - reproject( crs, crs ) transformed Feature of type schema throws: TransformException - throws: MismatchedDimensionException - throws: IllegalAttributeException - |
|
|