Interface GeometryAttribute
-
- All Known Implementing Classes:
GeometryAttributeImpl
public interface GeometryAttribute extends Attribute
An attribute which has a geometric value.The type of the value of the attribute is an arbitrary object and is implementation dependent. Implementations of this interface may wish to type narrow
Property.getValue()
to be specific about the type geometry. For instance to return explicitly a JTS geometry.Past a regular attribute, GeometryAttribute provides a method for obtaining the bounds of the underlying geometry,
getBounds()
. ThesetBounds(BoundingBox)
method is used to explicitly set the bounds which can be useful in situations where the data source stores the bounds explicitly along with the geometry.- Author:
- Jody Garnett, Refractions Research, Justin Deoliveira, The Open Planning Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BoundingBox
getBounds()
The bounds of the attribute.GeometryDescriptor
getDescriptor()
Override and type narrow to GeometryDescriptor.GeometryType
getType()
Override and type narrow to GeometryType.void
setBounds(BoundingBox bounds)
Sets the bounds of the geometry.-
Methods inherited from interface Attribute
getIdentifier, validate
-
Methods inherited from interface Property
getName, getUserData, getValue, hasUserData, isNillable, setValue
-
-
-
-
Method Detail
-
getType
GeometryType getType()
Override and type narrow to GeometryType.- Specified by:
getType
in interfaceAttribute
- Specified by:
getType
in interfaceProperty
- Returns:
- The attribute type.
- See Also:
Property.getType()
-
getDescriptor
GeometryDescriptor getDescriptor()
Override and type narrow to GeometryDescriptor.- Specified by:
getDescriptor
in interfaceAttribute
- Specified by:
getDescriptor
in interfaceProperty
- Returns:
- The geometry descriptor, may be null if this is a top-level value
- See Also:
Property.getDescriptor()
-
getBounds
BoundingBox getBounds()
The bounds of the attribute.This value should be derived unless explicitly set via
setBounds(BoundingBox)
.In the case that the underlying geometry is
null
, this method should return an empty bounds as opposed to returningnull
.- Returns:
- The bounds of the underlying geometry, possibly empty.
-
setBounds
void setBounds(BoundingBox bounds)
Sets the bounds of the geometry.This method should be used when the bounds is pre-computed and there is no need to derive it from scratch. This is mostly only relevant to data sources which store the bounds along with the geometry.
Setting the bounds to
null
is allowed and will force the bounds to be derived manually on the next call togetBounds()
.- Parameters:
bounds
- The bounds of the attribute.
-
-