public interface Feature extends ComplexAttribute
FeatureType
representing a geographic feature composed of geometric and
non-geometric properties.
Beyond being a complex attribute, a feature contains the following additional information:
FeatureType
Modifier and Type | Method and 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.
|
getProperties, getProperties, getProperties, getProperty, getProperty, getValue, setValue, validate
getDescriptor
getName, getUserData, isNillable, setValue
FeatureType getType()
getType
in interface Attribute
getType
in interface ComplexAttribute
getType
in interface Property
Attribute.getType()
FeatureId getIdentifier()
getType().isIdentifiable()
must return true
so this value must
not return null
.
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.
getIdentifier
in interface Attribute
null
.BoundingBox getBounds()
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 return
null
.
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 #getGeometryDescriptor()
should take precedence and the others should be reprojected
accordingly.
GeometryAttribute getDefaultGeometryProperty()
This method returns null
in the case where no such attribute exists.
null
.void setDefaultGeometryProperty(GeometryAttribute geometryAttribute)
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.
geometryAttribute
- The new geomtric attribute.IllegalArgumentException
- If the specified attribute is not already an attribute of
the feature.Copyright © 1996–2019 Geotools. All rights reserved.