DK for ActiveX | TatukGIS_XDK11.ITGIS_Shape.DistanceCS | Methods | Properties
Calculates geodetic distance from a point to the shape using the WGS84 (World Geodetic System 1984, EPSG:4326) ellipsoid model.
// C# public double DistanceCS( ITGIS_Point _ptg, double _prec );
' VisualBasic Public Function DistanceCS( ByVal _ptg As ITGIS_Point, ByVal _prec As Double ) As Double
// Oxygene public function DistanceCS( _ptg : ITGIS_Point; _prec : Double ) : Double;
| Name | Type | Description |
|---|---|---|
| _ptg | ITGIS_Point | Reference point in the shape's coordinate system. |
| _prec | double Double | Precision or search radius in meters. A point inside a polygon always returns a distance <= _prec. If _prec < 0, inside/outside distinction is ignored. |
| Type | Description |
|---|---|
| double Double | Distance in meters. Returns -1 if the coordinate system is unknown or undefined. For polygons, the value may be negative when the point is inside and _prec >= 0. |
PURPOSE: Measure real-world geodetic distance from a point to a vector shape while accounting for CRS (Coordinate Reference System) context and Earth curvature.
BEHAVIOR: Uses the layer coordinate system to evaluate the point-to-shape distance in geodetic space and returns the result in meters. This is more expensive than Distance because coordinate system handling is required.
CONSTRAINTS: Requires a valid coordinate system definition. Returns -1 when the spatial reference is not available.