org.geotools.feature
Interface GeometryAttributeType

All Superinterfaces:
AttributeType, PrimativeAttributeType
All Known Implementing Classes:
ChoiceAttributeType.Geometric, GeometricAttributeType

public interface GeometryAttributeType
extends AttributeType, PrimativeAttributeType

A CoordianteSystem aware Geometry AttributeType.

This class is the bridge between our FeatureType/AttributeType classes and the CoordianteSystem.

This also allows access to the GeometryFactory used by this GeometryAttributeType parse( Object ) method.

With JTS14 you can use GeometryFactory to to provide your own CoordianteSequence representation. CoordinateSystem is given the responsiblity of providing this class for the GeometryAttributeType as only it knows the CoordianteSequence class and PercisionModel mosted suitable. It also may know an SRID number suitable for the GeometryFactory to use when constructing new Geometry objects.

It is recomended that the CoordinateSystem GeometryFactory also supply the CoordinateSystem as the value for Geometry.getUserData().

Author:
Jody Garnett, Refractions Research, Inc.

Field Summary
 
Fields inherited from interface org.geotools.feature.AttributeType
UNBOUNDED
 
Method Summary
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateSystem()
          Retrieve the CS_CoordinateSystem used by this GeometryAttributeType.
 com.vividsolutions.jts.geom.GeometryFactory getGeometryFactory()
          Deprecated. Please use GeometrFactory associated with your FeatureFactory using the hinting system.
 Filter getRestriction()
          Restriction is assumed to be in agreement with Geometry class indicated.
 java.lang.Class getType()
          Type must be an sub type of Geometry.class.
 boolean isGeometry()
          Deprecated. replace with type instnaceof GeometryAttribtueType
 
Methods inherited from interface org.geotools.feature.AttributeType
createDefaultValue, duplicate, getMaxOccurs, getMinOccurs, getName, isNillable, parse, validate
 

Method Detail

getType

public java.lang.Class getType()
Type must be an sub type of Geometry.class.

If this was java I would say Class. Warning this will need revisiting for Geotools 2.2 when GeoAPI Geometry enters use.

Specified by:
getType in interface AttributeType
Returns:
Type.
See Also:
AttributeType.getType()

getRestriction

public Filter getRestriction()
Restriction is assumed to be in agreement with Geometry class indicated.

Specified by:
getRestriction in interface AttributeType
Returns:
Filter, or Filter.NONE if no restriction is needed.
See Also:
AttributeType.getRestriction()

getCoordinateSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateSystem()
Retrieve the CS_CoordinateSystem used by this GeometryAttributeType.

OUT OF DATE: The class CoordinateSystem holds a GeometryFactory that is used for creating new content. By extension this includes the SRID, PercisionModel and CoordinateSequenceFactory information.

Returns:
CS_CoordinateSystem for this GeometryAttributeType

getGeometryFactory

public com.vividsolutions.jts.geom.GeometryFactory getGeometryFactory()
Deprecated. Please use GeometrFactory associated with your FeatureFactory using the hinting system.

The Geometryfactory used for creating new content.

Replace with the following code:


 Map hints = new HashMap();
 hints.put( CoordinateReferneceSystem.class, type.getCoordinateSystem() ); 
 GeometryFactory gf = FactoryFinder.getGeometryFactory( Map hints );
 
 // You can now use gf create methods
 

Returns:
GeometryFactory used for new Content

isGeometry

public boolean isGeometry()
Deprecated. replace with type instnaceof GeometryAttribtueType

Must return true

See Also:
org.geotools.feature.AttributeType#isGeometry()


Copyright © GeoTools. All Rights Reserved.