Skip to end of metadata
Go to start of metadata

In order to maintain backwards compatability ( for the most part ) with the rest of the library, the old feature model will be made to extend the new one. The new feature model contains a "simple" component which maps closley to the old model. So what this boils down to is having the old model extend the simple components of the new model. More specifically:In order to maintain backwards compatability ( for the most part ) with the rest of the library, the old feature model will be made to extend the new one. The new feature model contains a "simple" component which maps closley to the old model. So what this boils down to is having the old model extend the simple components of the new model. More specifically:

(warning) denotes a naming conflict between a method in the old model and a method in the new model
(info) denotes a naming conflict which can be avoided with java 5 type narrowing

AttributeType

In the new model, the old idea of an AttributeType has been split into two concepts, namley AttributeDescriptor and AttributeType. The former will be extended by the old AttributeType. The following shows the mappings of the old methods to methods in the new api.

org.geotools.feature.AttributeType

org.opengis.feature.type.AttributeDescriptor

String getName()

getName().getLocalPart()

(warning)

Class getType()

getType().getBinding()

(warning)

Filter getRestriction()

getType().getRestrictions()

boolean isNillable()

isNillable()

int getMinOccurs()

getMinOccurs()

int getMaxOccurs()

getMaxOccurs()

Implementation Details

  • getName() renamed to name()
  • getType() renamed to binding()
  • AttributeType extends AttributeDescriptor
  • DefaultAttributeType extends AttributeDescriptorImpl
  • Remove unused AttributeType implementations:
    • ListAttributeType
    • SetAttributeType
    • ChoiceAttributeType
    • NestedAttributeType
    • FeatureAttributeType (question)
  • Handle other implementations of AttributeType:
    • ArcSDEAttributeType

AttributeType.parse()

This method has been used historically to convert strings or literals into an object of a particular type. Recently the Converter api has been developed to replace this method of converting literals to other types.

For this reason, there is really no reason to have any subclasses of AttributeType. Which means teh following can be deprecated:

  • PrimitiveAttributeType
  • GeometryAttributeType
  • GeometricAttributeType
  • NumericAttributeType
  • TextualAttributeType
  • TemporalAttributeType

FeatureType

The old FeatureType interfaces maps to the SimpleFeature interface in the new model. The interface mappings are:

org.geotools.feature.FeatureType

org.opengis.feature.simple.SimpleFeatureType

URI getNamespace()

getName().getNamespaceURI()

String getTypeName()

getName().getLocalPart()

boolean isAbstract()

isAbstract()

FeatureType[] getAnscestors()

AttributeType getSuper()

GeometryAttributeType getDefaultGeometry()

AttributeDescriptor getDefaultGeometry()

(warning)

(info)

int getAttributeCount()

getNumberOfAttributes()

AttributeType getAttributeType( int i )

(AttributeDescriptor) attributes().get( i )

AttributeType getAttributeType( String xpath )

(AttributeDescriptor) attributes().get( i )

int find(AttributeType type)

 

int find(String attName)

 

Implementation Details

  • getDefaultGeometry() renamed to ?
  • FeatureType extends SimpleFeatureType
  • DefaultFeatureType extends SimpleFeatureTypeImpl
  • Handle other FeatureType implementations
    • WFSFeatureType
    • VPFFeatureType

Issues

  • FeatureCollectionIteration compares FeatureType to AttributeType in type hierachy

Feature

As FeautreType maps to SimpleFeatureType, Feature maps to SimpleFeature. The interface mappings are:

org.geotools.feature.Feature

org.opengis.feature.simple.SimpleFeature

FeatureType getFeatureType()

getType()

String getID()

getID()

Object[] getAttributes()

getAttribute( String xpath )

get( xpath )

getAttribute( int index )

get( index )

setAttribute( int index, Object value )

set( index, value )

setAttribute( String xPath, Object value )

set( xPath value )

int getNumberOfAttributes()

getNumberOfAttributes()

Geometry getDefaultGeometry()

defaultGeometry()

(warning)

void setDefaultGeometry(Geometry geom)

defaultGeometry( geom )

Envelope getBounds()

BoundingBox getBounds()

(warning)

Implementation Details

  • getDefaultGeometry() renamed to ?
  • getBounds() renamed to bounds()
  • Feature extends SimpleFeature
  • DefaultFeature extends SimpleFeatureImpl
  • Update FeatureCollection implementations ? ( there is discussion about making FeatureCollection composed of a feature and a collection instead of an extension of both )

Issues

  • FeatureDocument
  • No labels