Interface Feature
-
- All Superinterfaces:
Attribute
,ComplexAttribute
,Property
- All Known Subinterfaces:
SimpleFeature
- All Known Implementing Classes:
DecoratingFeature
,FeatureImpl
,JDBCFeatureReader.ResultSetFeature
,MongoDBObjectFeature
,MongoFeature
,PreGeneralizedSimpleFeature
,SimpleFeatureImpl
public interface Feature extends ComplexAttribute
An instance ofFeatureType
representing a geographic feature composed of geometric and non-geometric properties.Beyond being a complex attribute, a feature contains the following additional information:
- A default geometry. To be used when drawing when nothing more specific has been provided.
- The bounds of all the geometric attributes of the feature
- Since:
- GeoAPI 2.2
- Author:
- Jody Garnett (Refractions Research), Justin Deoliveira (The Open Planning Project)
- See Also:
FeatureType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BoundingBox
getBounds()
The bounds of this Feature, if available.GeometryAttribute
getDefaultGeometryProperty()
The default geometric attribute of the feature.FeatureId
getIdentifier()
A unique identifier for the feature.FeatureType
getType()
Override and type narrow to FeatureType.void
setDefaultGeometryProperty(GeometryAttribute geometryAttribute)
Sets the default geometric attribute of the feature.-
Methods inherited from interface Attribute
getDescriptor
-
Methods inherited from interface ComplexAttribute
getProperties, getProperties, getProperties, getProperty, getProperty, getValue, setValue, validate
-
Methods inherited from interface Property
getName, getUserData, hasUserData, isNillable, setValue
-
-
-
-
Method Detail
-
getType
FeatureType getType()
Override and type narrow to FeatureType.- Specified by:
getType
in interfaceAttribute
- Specified by:
getType
in interfaceComplexAttribute
- Specified by:
getType
in interfaceProperty
- Returns:
- The feature type
- See Also:
Attribute.getType()
-
getIdentifier
FeatureId getIdentifier()
A unique identifier for the feature.getType().isIdentifiable()
must returntrue
so this value must not returnnull
.Generation of the identifier is dependent on the underlying data storage medium. Often this identifier is not persistent. Mediums such shapefiles and database tables have "keys" built in which map naturally to persistent feature identifiers. But other mediums do not have such keys and may have to generate feature identifiers "on-the-fly". This means that client code being able to depend on this value as a persistent entity is dependent on which storage medium or data source is being used.
- Specified by:
getIdentifier
in interfaceAttribute
- Returns:
- The feature identifier, never
null
.
-
getBounds
BoundingBox getBounds()
The bounds of this Feature, if available.This value is derived from any geometric attributes that the feature is composed of.
In the case that the feature has no geometric attributes this method should return an empty bounds, ie,
bounds.isEmpty() == true
. This method should never returnnull
.The coordinate reference system of the returned bounds is derived from the geometric attributes which were used to compute the bounds. In the event that the feature contains multiple geometric attributes which have different crs's, the one defined by
getDefaultGeometryProperty()
should take precedence and the others should be reprojected accordingly.- Returns:
- the feature bounds, possibly empty.
-
getDefaultGeometryProperty
GeometryAttribute getDefaultGeometryProperty()
The default geometric attribute of the feature.This method returns
null
in the case where no such attribute exists.- Returns:
- The default geometry attribute, or
null
.
-
setDefaultGeometryProperty
void setDefaultGeometryProperty(GeometryAttribute geometryAttribute)
Sets the default geometric attribute of the feature.This value must be an attribute which is already defined for the feature. In other words, this method can not be used to add a new attribute to the feature.
- Parameters:
geometryAttribute
- The new geomtric attribute.- Throws:
IllegalArgumentException
- If the specified attribute is not already an attribute of the feature.
-
-