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
public class FeatureAgent<T> extends Object implements 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
Fields Modifier and Type Field Description protected org.opengis.feature.simple.SimpleFeatureType
featureType
protected String
geometryName
protected org.opengis.filter.identity.FeatureId
id
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getAgent()
Gets the agent that this FeatureAgent wraps.Object
getAttribute(int index)
Object
getAttribute(String name)
Object
getAttribute(org.opengis.feature.type.Name name)
int
getAttributeCount()
List<Object>
getAttributes()
org.opengis.geometry.BoundingBox
getBounds()
org.locationtech.jts.geom.Geometry
getDefaultGeometry()
org.opengis.feature.GeometryAttribute
getDefaultGeometryProperty()
org.opengis.feature.type.AttributeDescriptor
getDescriptor()
org.opengis.feature.simple.SimpleFeatureType
getFeatureType()
String
getID()
org.opengis.filter.identity.FeatureId
getIdentifier()
org.opengis.feature.type.Name
getName()
Collection<org.opengis.feature.Property>
getProperties()
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()
Map<Object,Object>
getUserData()
Collection<? extends org.opengis.feature.Property>
getValue()
boolean
isNillable()
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
setValue(Object arg0)
void
setValue(Collection<org.opengis.feature.Property> arg0)
void
validate()
-
-
-
Field Detail
-
id
protected org.opengis.filter.identity.FeatureId id
-
featureType
protected org.opengis.feature.simple.SimpleFeatureType featureType
-
geometryName
protected String geometryName
-
-
Constructor Detail
-
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 Detail
-
getAgent
public T getAgent()
Gets the agent that this FeatureAgent wraps.- Returns:
- the agent that this FeatureAgent wraps.
-
getID
public String 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
public List<Object> getAttributes()
- Specified by:
getAttributes
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
SimpleFeature.getAttributes()
-
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
SimpleFeature.getAttribute(String)
-
setAttribute
public void setAttribute(String name, Object obj)
- Specified by:
setAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
SimpleFeature.setAttribute(String, Object)
-
getAttribute
public Object getAttribute(org.opengis.feature.type.Name name)
- Specified by:
getAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
SimpleFeature.getAttribute(Name)
-
setAttribute
public void setAttribute(org.opengis.feature.type.Name name, Object value)
- Specified by:
setAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
SimpleFeature.setAttribute(Name, Object)
-
getAttribute
public Object getAttribute(int index)
- Specified by:
getAttribute
in interfaceorg.opengis.feature.simple.SimpleFeature
- See Also:
SimpleFeature.getAttribute(int)
-
setAttribute
public void setAttribute(int index, Object val) throws IndexOutOfBoundsException
- 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
public void setDefaultGeometry(Object geometry)
- 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
public Map<Object,Object> getUserData()
- Specified by:
getUserData
in interfaceorg.opengis.feature.Property
- See Also:
Property.getUserData()
-
getProperties
public Collection<org.opengis.feature.Property> getProperties()
- Specified by:
getProperties
in interfaceorg.opengis.feature.ComplexAttribute
-
getProperties
public Collection<org.opengis.feature.Property> getProperties(org.opengis.feature.type.Name arg0)
- Specified by:
getProperties
in interfaceorg.opengis.feature.ComplexAttribute
-
getProperties
public Collection<org.opengis.feature.Property> getProperties(String arg0)
- 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
public org.opengis.feature.Property getProperty(String arg0)
- Specified by:
getProperty
in interfaceorg.opengis.feature.ComplexAttribute
-
getValue
public Collection<? extends org.opengis.feature.Property> getValue()
- Specified by:
getValue
in interfaceorg.opengis.feature.ComplexAttribute
- Specified by:
getValue
in interfaceorg.opengis.feature.Property
-
setValue
public void setValue(Collection<org.opengis.feature.Property> arg0)
- 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
public void setValue(Object arg0)
- Specified by:
setValue
in interfaceorg.opengis.feature.Property
-
setAttributes
public void setAttributes(List<Object> arg0)
- Specified by:
setAttributes
in interfaceorg.opengis.feature.simple.SimpleFeature
-
setAttributes
public void setAttributes(Object[] arg0)
- Specified by:
setAttributes
in interfaceorg.opengis.feature.simple.SimpleFeature
-
-