org.geotools.feature.type
Class ChoiceAttributeType.Geometric

Object
  extended by PropertyDescriptorImpl
      extended by AttributeDescriptorImpl
          extended by ChoiceAttributeType
              extended by ChoiceAttributeType.Geometric
All Implemented Interfaces:
AttributeType, GeometryAttributeType, PrimativeAttributeType, AttributeDescriptor, GeometryDescriptor, PropertyDescriptor
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
TODO:
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/interfaces inherited from class ChoiceAttributeType
ChoiceAttributeType.Geometric
 
Field Summary
 
Fields inherited from class AttributeDescriptorImpl
defaultValue
 
Fields inherited from class PropertyDescriptorImpl
isNillable, maxOccurs, minOccurs, name, type
 
Constructor Summary
ChoiceAttributeType.Geometric(ChoiceAttributeType.Geometric copy)
           
ChoiceAttributeType.Geometric(String name, GeometryAttributeType[] children)
           
ChoiceAttributeType.Geometric(String name, int min, int max, GeometryAttributeType[] children, Filter restriction)
           
 
Method Summary
 CoordinateReferenceSystem getCoordinateReferenceSystem()
           
 CoordinateReferenceSystem getCoordinateSystem()
          Retrieve the CS_CoordinateSystem used by this GeometryAttributeType.
 GeometryFactory getGeometryFactory()
          The Geometryfactory used for creating new content.
 GeometryType getType()
           
 boolean isGeometry()
          Must return true
 
Methods inherited from class ChoiceAttributeType
calculateNillable, copyChildren, createDefaultValue, duplicate, equals, find, find, getAttributeCount, getAttributeType, getAttributeType, getAttributeTypes, getBinding, getLocalName, getRestriction, hasAttributeType, hashCode, parse, toString, validate
 
Methods inherited from class AttributeDescriptorImpl
getDefaultValue
 
Methods inherited from class PropertyDescriptorImpl
getMaxOccurs, getMinOccurs, getName, getUserData, isNillable
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface GeometryAttributeType
getBinding, getRestriction
 

Constructor Detail

ChoiceAttributeType.Geometric

public ChoiceAttributeType.Geometric(ChoiceAttributeType.Geometric copy)

ChoiceAttributeType.Geometric

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

ChoiceAttributeType.Geometric

public ChoiceAttributeType.Geometric(String name,
                                     GeometryAttributeType[] children)
Method Detail

getType

public GeometryType getType()
Specified by:
getType in interface AttributeDescriptor
Specified by:
getType in interface GeometryDescriptor
Specified by:
getType in interface PropertyDescriptor
Overrides:
getType in class AttributeDescriptorImpl

getCoordinateSystem

public 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:
The coordinate reference system for this GeometryAttributeType

getCoordinateReferenceSystem

public CoordinateReferenceSystem getCoordinateReferenceSystem()
Specified by:
getCoordinateReferenceSystem in interface GeometryDescriptor

getGeometryFactory

public 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
See Also:
org.geotools.feature.AttributeType#isGeometry()


Copyright © 1996-2009 Geotools. All Rights Reserved.