org.geotools.feature.type
Class ChoiceAttributeType.Geometric

java.lang.Object
  extended byorg.geotools.feature.type.ChoiceAttributeType
      extended byorg.geotools.feature.type.ChoiceAttributeType.Geometric
All Implemented Interfaces:
AttributeType, GeometryAttributeType, PrimativeAttributeType
Enclosing class:
ChoiceAttributeType

public static final class ChoiceAttributeType.Geometric
extends ChoiceAttributeType
implements GeometryAttributeType

A special class that is made so a Choice can serve as the Default Geometry in a FeatureType, by implementing GeometryAttributeType. It must be a choice between other GeometryAttributeTypes.

Author:
Chris Holmes, TOPP
Task:
TODO: Need to write code to check that all the geometry attributes are in the same crs. Right now we just blindly assume they are and return the first.

Nested Class Summary
 
Nested classes inherited from class org.geotools.feature.type.ChoiceAttributeType
ChoiceAttributeType.Geometric
 
Field Summary
 
Fields inherited from interface org.geotools.feature.AttributeType
UNBOUNDED
 
Constructor Summary
ChoiceAttributeType.Geometric(ChoiceAttributeType.Geometric copy)
           
ChoiceAttributeType.Geometric(java.lang.String name, GeometryAttributeType[] children)
           
ChoiceAttributeType.Geometric(java.lang.String name, int min, int max, GeometryAttributeType[] children, Filter restriction)
           
 
Method Summary
 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.
 boolean isGeometry()
          Must return true
 
Methods inherited from class org.geotools.feature.type.ChoiceAttributeType
calculateNillable, copyChildren, createDefaultValue, duplicate, equals, find, find, getAttributeCount, getAttributeType, getAttributeType, getAttributeTypes, getMaxOccurs, getMinOccurs, getName, getRestriction, getType, hasAttributeType, hashCode, isNillable, parse, 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
getRestriction, getType
 
Methods inherited from interface org.geotools.feature.AttributeType
createDefaultValue, duplicate, getMaxOccurs, getMinOccurs, getName, isNillable, parse, validate
 

Constructor Detail

ChoiceAttributeType.Geometric

public ChoiceAttributeType.Geometric(ChoiceAttributeType.Geometric copy)

ChoiceAttributeType.Geometric

public ChoiceAttributeType.Geometric(java.lang.String name,
                                     int min,
                                     int max,
                                     GeometryAttributeType[] children,
                                     Filter restriction)

ChoiceAttributeType.Geometric

public ChoiceAttributeType.Geometric(java.lang.String name,
                                     GeometryAttributeType[] children)
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

isGeometry

public boolean isGeometry()
Description copied from interface: GeometryAttributeType
Must return true

Specified by:
isGeometry in interface GeometryAttributeType
Overrides:
isGeometry in class ChoiceAttributeType


Copyright © GeoTools. All Rights Reserved.