Package repast.simphony.space.gis
Class FeatureAgent<T>
java.lang.Object
repast.simphony.space.gis.FeatureAgent<T>
- All Implemented Interfaces:
org.opengis.feature.Attribute
,org.opengis.feature.ComplexAttribute
,org.opengis.feature.Feature
,org.opengis.feature.Property
,org.opengis.feature.simple.SimpleFeature
Wraps a POJO in a GIS feature. The POJO's properties become feature
attributes. The feature's geometry is derived from the POJO and a Geography.
The FeatureAgent is primarily used by the GeoTools-based displays and the
shapefile writer utility that require SimpleFeature instances that
mirror the agent properties.
- Author:
- Nick Collier, Eric Tatara
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.opengis.feature.simple.SimpleFeatureType
protected String
protected org.opengis.filter.identity.FeatureId
-
Constructor Summary
ConstructorDescriptionFeatureAgent
(org.opengis.feature.simple.SimpleFeatureType type, T agent, Geography geog, List<FeatureAttributeAdapter> adapters, List<repast.simphony.space.gis.FeatureAgentFactory.ObjectClassAttributeData> classAttributeList) Creates a FeatureAgent from the specified FeatureType, agent and geography. -
Method Summary
Modifier and TypeMethodDescriptiongetAgent()
Gets the agent that this FeatureAgent wraps.getAttribute
(int index) getAttribute
(String name) getAttribute
(org.opengis.feature.type.Name name) int
org.opengis.geometry.BoundingBox
org.locationtech.jts.geom.Geometry
org.opengis.feature.GeometryAttribute
org.opengis.feature.type.AttributeDescriptor
org.opengis.feature.simple.SimpleFeatureType
getID()
org.opengis.filter.identity.FeatureId
org.opengis.feature.type.Name
getName()
Collection<org.opengis.feature.Property>
Collection<org.opengis.feature.Property>
getProperties
(String arg0) Collection<org.opengis.feature.Property>
getProperties
(org.opengis.feature.type.Name arg0) org.opengis.feature.Property
getProperty
(String arg0) org.opengis.feature.Property
getProperty
(org.opengis.feature.type.Name arg0) org.opengis.feature.simple.SimpleFeatureType
getType()
Collection<? extends org.opengis.feature.Property>
getValue()
boolean
void
setAttribute
(int index, Object val) void
setAttribute
(String name, Object obj) void
setAttribute
(org.opengis.feature.type.Name name, Object value) void
setAttributes
(Object[] arg0) void
setAttributes
(List<Object> arg0) void
setDefaultGeometry
(Object geometry) void
setDefaultGeometryProperty
(org.opengis.feature.GeometryAttribute geometryAttribute) void
void
setValue
(Collection<org.opengis.feature.Property> arg0) void
validate()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opengis.feature.Property
hasUserData
-
Field Details
-
id
protected org.opengis.filter.identity.FeatureId id -
featureType
protected org.opengis.feature.simple.SimpleFeatureType featureType -
geometryName
-
-
Constructor Details
-
FeatureAgent
public FeatureAgent(org.opengis.feature.simple.SimpleFeatureType type, T agent, Geography geog, List<FeatureAttributeAdapter> adapters, List<repast.simphony.space.gis.FeatureAgentFactory.ObjectClassAttributeData> classAttributeList) Creates a FeatureAgent from the specified FeatureType, agent and geography. The geometry of the feature will be supplied by the geography. The agent's properties will become attributes of the feature. The list of adapters will become additional attributes for those that cannot be mapped directly to an agents properties.- Parameters:
type
-agent
-geography
-adapters
-
-
-
Method Details
-
getAgent
Gets the agent that this FeatureAgent wraps.- Returns:
- the agent that this FeatureAgent wraps.
-
getID
- Specified by:
getID
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.getID()
-
getType
public org.opengis.feature.simple.SimpleFeatureType getType()- Specified by:
getType
in interfaceorg.opengis.feature.Attribute
- Specified by:
getType
in interfaceorg.opengis.feature.ComplexAttribute
- Specified by:
getType
in interfaceorg.opengis.feature.Feature
- Specified by:
getType
in interfaceorg.opengis.feature.Property
- Specified by:
getType
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.getType()
-
getFeatureType
public org.opengis.feature.simple.SimpleFeatureType getFeatureType()- Specified by:
getFeatureType
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.getFeatureType()
-
getIdentifier
public org.opengis.filter.identity.FeatureId getIdentifier()- Specified by:
getIdentifier
in interfaceorg.opengis.feature.Attribute
- Specified by:
getIdentifier
in interfaceorg.opengis.feature.Feature
- See Also:
-
Feature.getIdentifier()
-
getAttributes
- Specified by:
getAttributes
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.getAttributes()
-
getAttribute
- Specified by:
getAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.getAttribute(String)
-
setAttribute
- Specified by:
setAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.setAttribute(String, Object)
-
getAttribute
- Specified by:
getAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.getAttribute(Name)
-
setAttribute
- Specified by:
setAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.setAttribute(Name, Object)
-
getAttribute
- Specified by:
getAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.getAttribute(int)
-
setAttribute
- Specified by:
setAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- Throws:
IndexOutOfBoundsException
- See Also:
-
SimpleFeature.setAttribute(int, Object)
-
getAttributeCount
public int getAttributeCount()- Specified by:
getAttributeCount
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.getAttributeCount()
-
getDefaultGeometry
public org.locationtech.jts.geom.Geometry getDefaultGeometry()- Specified by:
getDefaultGeometry
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.getDefaultGeometry()
-
setDefaultGeometry
- Specified by:
setDefaultGeometry
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
-
SimpleFeature.setDefaultGeometry(Object)
-
getBounds
public org.opengis.geometry.BoundingBox getBounds()- Specified by:
getBounds
in interfaceorg.opengis.feature.Feature
- See Also:
-
Feature.getBounds()
-
getDefaultGeometryProperty
public org.opengis.feature.GeometryAttribute getDefaultGeometryProperty()- Specified by:
getDefaultGeometryProperty
in interfaceorg.opengis.feature.Feature
- See Also:
-
Feature.getDefaultGeometryProperty()
-
setDefaultGeometryProperty
public void setDefaultGeometryProperty(org.opengis.feature.GeometryAttribute geometryAttribute) - Specified by:
setDefaultGeometryProperty
in interfaceorg.opengis.feature.Feature
- See Also:
-
Feature.setDefaultGeometryProperty(GeometryAttribute)
-
isNillable
public boolean isNillable()- Specified by:
isNillable
in interfaceorg.opengis.feature.Property
- See Also:
-
Property.isNillable()
-
getName
public org.opengis.feature.type.Name getName()- Specified by:
getName
in interfaceorg.opengis.feature.Property
- See Also:
-
Property.getName()
-
getDescriptor
public org.opengis.feature.type.AttributeDescriptor getDescriptor()- Specified by:
getDescriptor
in interfaceorg.opengis.feature.Attribute
- Specified by:
getDescriptor
in interfaceorg.opengis.feature.Property
- See Also:
-
Attribute.getDescriptor()
-
getUserData
- Specified by:
getUserData
in interfaceorg.opengis.feature.Property
- See Also:
-
Property.getUserData()
-
getProperties
- Specified by:
getProperties
in interfaceorg.opengis.feature.ComplexAttribute
-
getProperties
- Specified by:
getProperties
in interfaceorg.opengis.feature.ComplexAttribute
-
getProperties
- Specified by:
getProperties
in interfaceorg.opengis.feature.ComplexAttribute
-
getProperty
public org.opengis.feature.Property getProperty(org.opengis.feature.type.Name arg0) - Specified by:
getProperty
in interfaceorg.opengis.feature.ComplexAttribute
-
getProperty
- Specified by:
getProperty
in interfaceorg.opengis.feature.ComplexAttribute
-
getValue
- Specified by:
getValue
in interfaceorg.opengis.feature.ComplexAttribute
- Specified by:
getValue
in interfaceorg.opengis.feature.Property
-
setValue
- Specified by:
setValue
in interfaceorg.opengis.feature.ComplexAttribute
-
validate
public void validate() throws org.opengis.feature.IllegalAttributeException- Specified by:
validate
in interfaceorg.opengis.feature.Attribute
- Specified by:
validate
in interfaceorg.opengis.feature.ComplexAttribute
- Throws:
org.opengis.feature.IllegalAttributeException
-
setValue
- Specified by:
setValue
in interfaceorg.opengis.feature.Property
-
setAttributes
- Specified by:
setAttributes
in interfaceorg.opengis.feature.simple.SimpleFeature
-
setAttributes
- Specified by:
setAttributes
in interfaceorg.opengis.feature.simple.SimpleFeature
-