org.geotools.feature.type
Class GeometricAttributeType

java.lang.Object
  extended byorg.geotools.feature.DefaultAttributeType
      extended byorg.geotools.feature.type.GeometricAttributeType
All Implemented Interfaces:
AttributeType, GeometryAttributeType, PrimativeAttributeType

public class GeometricAttributeType
extends DefaultAttributeType
implements GeometryAttributeType

Provides ...TODO summary sentence

TODO Description

Example Use:


 GeometryAttributeType x = new GeometryAttributeType( ... );
 TODO code example
 

Since:
0.3 TODO: test wkt geometry parse.
Author:
Leprosy

Field Summary
protected  org.opengis.referencing.crs.CoordinateReferenceSystem coordinateSystem
          CoordianteSystem used by this GeometryAttributeType
protected  com.vividsolutions.jts.geom.GeometryFactory geometryFactory
           
 
Fields inherited from class org.geotools.feature.DefaultAttributeType
defaultValue, max, min, name, nillable, type
 
Fields inherited from interface org.geotools.feature.AttributeType
UNBOUNDED
 
Constructor Summary
GeometricAttributeType(GeometricAttributeType copy, org.opengis.referencing.crs.CoordinateReferenceSystem override)
           
GeometricAttributeType(java.lang.String name, java.lang.Class type, boolean nillable, int min, int max, java.lang.Object defaultValue, org.opengis.referencing.crs.CoordinateReferenceSystem cs, Filter filter)
           
GeometricAttributeType(java.lang.String name, java.lang.Class type, boolean nillable, java.lang.Object defaultValue, org.opengis.referencing.crs.CoordinateReferenceSystem cs, Filter filter)
           
 
Method Summary
 java.lang.Object duplicate(java.lang.Object o)
          Create a duplicate value of the passed Object.
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateSystem()
          Retrieve the CS_CoordinateSystem used by this GeometryAttributeType.
 com.vividsolutions.jts.geom.GeometryFactory getGeometryFactory()
          The Geometryfactory used for creating new content.
 Filter getRestriction()
          Restriction is assumed to be in agreement with Geometry class indicated.
 java.lang.Object parse(java.lang.Object value)
          Allows this AttributeType to convert an argument to its prefered storage type.
 
Methods inherited from class org.geotools.feature.DefaultAttributeType
createDefaultValue, equals, getMaxOccurs, getMinOccurs, getName, getType, hashCode, isGeometry, isNillable, toString, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.feature.GeometryAttributeType
getType, isGeometry
 
Methods inherited from interface org.geotools.feature.AttributeType
createDefaultValue, getMaxOccurs, getMinOccurs, getName, isNillable, validate
 

Field Detail

coordinateSystem

protected org.opengis.referencing.crs.CoordinateReferenceSystem coordinateSystem
CoordianteSystem used by this GeometryAttributeType


geometryFactory

protected com.vividsolutions.jts.geom.GeometryFactory geometryFactory
Constructor Detail

GeometricAttributeType

public GeometricAttributeType(java.lang.String name,
                              java.lang.Class type,
                              boolean nillable,
                              int min,
                              int max,
                              java.lang.Object defaultValue,
                              org.opengis.referencing.crs.CoordinateReferenceSystem cs,
                              Filter filter)

GeometricAttributeType

public GeometricAttributeType(java.lang.String name,
                              java.lang.Class type,
                              boolean nillable,
                              java.lang.Object defaultValue,
                              org.opengis.referencing.crs.CoordinateReferenceSystem cs,
                              Filter filter)

GeometricAttributeType

public GeometricAttributeType(GeometricAttributeType copy,
                              org.opengis.referencing.crs.CoordinateReferenceSystem override)
Method Detail

getCoordinateSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateSystem()
Description copied from interface: GeometryAttributeType
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.

Specified by:
getCoordinateSystem in interface GeometryAttributeType
Returns:
CS_CoordinateSystem for this GeometryAttributeType

getGeometryFactory

public com.vividsolutions.jts.geom.GeometryFactory getGeometryFactory()
Description copied from interface: GeometryAttributeType
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
 

Specified by:
getGeometryFactory in interface GeometryAttributeType
Returns:
GeometryFactory used for new Content

parse

public java.lang.Object parse(java.lang.Object value)
                       throws java.lang.IllegalArgumentException
Description copied from interface: AttributeType
Allows this AttributeType to convert an argument to its prefered storage type. If no parsing is possible, returns the original value. If a parse is attempted, yet fails (i.e. a poor decimal format) throw the Exception. This is mostly for use internally in Features, but implementors should simply follow the rules to be safe.

Specified by:
parse in interface AttributeType
Overrides:
parse in class DefaultAttributeType
Parameters:
value - the object to attempt parsing of.
Returns:
value converted to the preferred storage of this AttributeType. If no parsing was possible then the same object is returned.
Throws:
java.lang.IllegalArgumentException - if parsing is attempted and is unsuccessful.

duplicate

public java.lang.Object duplicate(java.lang.Object o)
                           throws IllegalAttributeException
Description copied from interface: AttributeType
Create a duplicate value of the passed Object. For immutable Objects, it is not neccessary to create a new Object.

Specified by:
duplicate in interface AttributeType
Overrides:
duplicate in class DefaultAttributeType
Returns:
A duplicated Object if the type is mutable or the same Object if it is immutable or null if the passed Object is null.
Throws:
IllegalAttributeException - if the Object cannot be duplicated.

getRestriction

public Filter getRestriction()
Description copied from interface: GeometryAttributeType
Restriction is assumed to be in agreement with Geometry class indicated.

Specified by:
getRestriction in interface GeometryAttributeType
Overrides:
getRestriction in class DefaultAttributeType


Copyright © GeoTools. All Rights Reserved.