Class TLcdSphericalAdvancedBinaryTopology
- All Implemented Interfaces:
ILcd2DAdvancedBinaryTopology
ILcd2DAdvancedBinaryTopology on a spherical model.
This implementation currently supports instances of the following interfaces:
- ILcdPoint,
- ILcdPolyline,
- ILcdPolygon,
- ILcdComplexPolygon,
- ILcdArc,
- ILcdCircularArc,
- ILcdEllipse,
- ILcdCircle,
- ILcdBounds,
- ILcdArcBand,
- ILcdGeoBuffer,
- ILcdVariableGeoBuffer.
Performance
The current implementation caches (intermediate) results for ILcdShape instances which implement the ILcdCache interface.
When performing repeated checks with the same shape or shapes, it is generally more efficient to reuse the same ILcd2DAdvancedBinaryTopology object,
instead of creating a new instance for every check.
- Since:
- 10.0
-
Constructor Summary
ConstructorsConstructorDescriptionTLcdSphericalAdvancedBinaryTopology(double aRadius) Constructor for TLcdSphericalAdvancedBinaryTopologyTLcdSphericalAdvancedBinaryTopology(double aRadius, double aTolerance) Constructor for TLcdSphericalAdvancedBinaryTopology allowing to specify a tolerance. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckTopology(ILcdShape aShape1, ILcdShape aShape2, ILcdIntersectionMatrixPattern aMatrixPattern) Checks whether the two given shapes satisfy the binary topology relation defined by the given matrix pattern.computeIntersectionMatrix(ILcdShape aShape1, ILcdShape aShape2) Computes the intersection matrix of the two given shapes.doubleReturns the radius of the sphere on which the binary topology relations are computeddoubleReturns the tolerance value (expressed in meters) used in the binary topology computations when checking the equality of two points.voidsetRadius(double aRadius) Sets the radius of the sphere on which the binary topology relations are computedvoidsetTolerance(double aTolerance) Sets the tolerance value used in the binary topology computations when checking the equality of two points.
-
Constructor Details
-
TLcdSphericalAdvancedBinaryTopology
public TLcdSphericalAdvancedBinaryTopology(double aRadius) Constructor for TLcdSphericalAdvancedBinaryTopology- Parameters:
aRadius- radius (expressed in meters) of the sphere on which the binary topology relations are computed
-
TLcdSphericalAdvancedBinaryTopology
public TLcdSphericalAdvancedBinaryTopology(double aRadius, double aTolerance) Constructor for TLcdSphericalAdvancedBinaryTopology allowing to specify a tolerance.
In some cases, the result obtained when checking the topological relation between two shapes depends on the accuracy of the data used to represent both shapes.
For example, you would expect that neighboring countries touch but not overlap. However, if the contours of the polygons used to represent both countries slightly cross at the common border (due to small errors in the data), the calculations would lead to the opposite result.
This constructor allow you to set a tolerance value which is taken into account in the topology calculations. Points that lie within this tolerance value from each other are considered to be coincident.
- Parameters:
aRadius- radius (expressed in meters) of the sphere on which the binary topology relations are computedaTolerance- tolerance value (expressed in meters) used to determine the equality of two points in the topology calculations. This value should be larger than 0.01m.
-
-
Method Details
-
computeIntersectionMatrix
Description copied from interface:ILcd2DAdvancedBinaryTopologyComputes the intersection matrix of the two given shapes. Both shapes must be in the same coordinate system.- Specified by:
computeIntersectionMatrixin interfaceILcd2DAdvancedBinaryTopology- Parameters:
aShape1- the first shapeaShape2- the second shape- Returns:
- the intersection matrix of the two given shapes
-
checkTopology
public boolean checkTopology(ILcdShape aShape1, ILcdShape aShape2, ILcdIntersectionMatrixPattern aMatrixPattern) Description copied from interface:ILcd2DAdvancedBinaryTopologyChecks whether the two given shapes satisfy the binary topology relation defined by the given matrix pattern. Both shapes must be in the same coordinate system.- Specified by:
checkTopologyin interfaceILcd2DAdvancedBinaryTopology- Parameters:
aShape1- the first shapeaShape2- the second shapeaMatrixPattern- the matrix pattern defining the binary topology relation to be checked- Returns:
trueif the binary topology relation defined byaMatrixPatternholdstrueforaShape1andaShape2, false otherwise.
-
getTolerance
public double getTolerance()Returns the tolerance value (expressed in meters) used in the binary topology computations when checking the equality of two points.- Returns:
- the tolerance value (expressed in meters) used in the binary topology computations when checking the equality of two points.
-
setTolerance
public void setTolerance(double aTolerance) Sets the tolerance value used in the binary topology computations when checking the equality of two points. The tolerance value should be expressed in meters. (The default value is 0.01m.)- Parameters:
aTolerance- the tolerance value (expressed in meters) used in the binary topology computations.
-
getRadius
public double getRadius()Returns the radius of the sphere on which the binary topology relations are computed- Returns:
- radius of the sphere on which the binary topology relations are computed (expressed in meters).
-
setRadius
public void setRadius(double aRadius) Sets the radius of the sphere on which the binary topology relations are computed- Parameters:
aRadius- radius of the sphere on which the binary topology relations are computed (expressed in meters).
-