Package com.luciad.util
Class TLcdHasGeometryAnnotation
java.lang.Object
com.luciad.util.TLcdHasGeometryAnnotation
- All Implemented Interfaces:
ILcdAnnotation
- Direct Known Subclasses:
TLcdHasAShapeAnnotation
Types with this annotation expose their geometry through their data properties.
The supported geometry property types in LuciadLightspeed areILcdShape
for vector data and ALcdImage
for image data.
Uses
- create geospatial domain objects that do not implement
ILcdShape
orALcdImage
- access the geometry of the above mentioned domain objects
Example
To access a domain object's geometry, you can make use of the following convenience functions:
ALcdShape.fromDomainObject
to retrieve anILcdShape
ALcdImage.fromDomainObject
to retrieve anALcdImage
ALcdBounds.fromDomainObject
to retrieve the geometry's bounds
To create a has-a-geometry data type, add the annotation right after creating the data model.
The following snippet defines a point-based domain object:
TLcdDataModelBuilder builder = new TLcdDataModelBuilder("http://www.mydomain.com/datamodel/myDataModel");
TLcdDataTypeBuilder hasAShapeType = builder.typeBuilder("HasAShapeType");
hasAShapeType.addProperty("Point", TLcdShapeDataTypes.POINT_TYPE);
// add other properties here
// ...
TLcdDataModel dataModel = builder.createDataModel();
TLcdDataType type = dataModel.getDeclaredType("HasAShapeType");
type.addAnnotation(new TLcdHasGeometryAnnotation(type.getProperty("Point")));
The fundamentals samples show how to define and use has-a-shape domain objects.- Since:
- 2015.0
-
Constructor Summary
ConstructorDescriptionTLcdHasGeometryAnnotation
(TLcdDataProperty aGeometryProperty) Creates a new has-geometry annotation that indicates that the geometry can be accessed using the given data property. -
Method Summary
Modifier and TypeMethodDescriptionReturns the property using which the geometry can be accessed.
-
Constructor Details
-
TLcdHasGeometryAnnotation
Creates a new has-geometry annotation that indicates that the geometry can be accessed using the given data property.- Parameters:
aGeometryProperty
- the geometry property if the geometry is encoded in a single property, or null if the geometry property is not known, or if the geometry is encoded in several properties.
-
-
Method Details
-
getGeometryProperty
Returns the property using which the geometry can be accessed. The returned property can benull
if the geometry property is not known, or if the geometry is encoded in several properties.- Returns:
- the property using which the geometry can be accessed.
-