DK for ActiveX | TatukGIS_XDK11.ITGIS_Shape.Distance2PartCS | Methods | Properties
Calculates geodetic distance from a point to a specific shape part using the WGS84 (World Geodetic System 1984, EPSG:4326) model.
// C# public double Distance2PartCS( ITGIS_Point _ptg, double _prec, int _part, ref ITGIS_Point _proj );
' VisualBasic Public Function Distance2PartCS( ByVal _ptg As ITGIS_Point, ByVal _prec As Double, ByVal _part As Integer, ByRef _proj As ITGIS_Point ) As Double
// Oxygene public function Distance2PartCS( _ptg : ITGIS_Point; _prec : Double; _part : Integer; var _proj : ITGIS_Point ) : Double;
| Name | Type | Description |
|---|---|---|
| _ptg | ITGIS_Point | Reference point in the shape's coordinate system. |
| _prec | double Double | Precision or search radius in meters. For polygons, a point inside the shape always returns a distance <= _prec. If _prec < 0, inside/outside distinction is ignored. |
| _part | int Integer | Zero-based part index for which the distance is calculated. |
| _proj | ITGIS_Point | Output point receiving the perpendicular projection of _ptg onto the specified shape part. |
| Type | Description |
|---|---|
| double Double | Geodetic distance in meters, or -1 if the coordinate system is undefined or invalid. |
PURPOSE: Measure real-world distance from a point to a single part of a multipart geometry, such as one polygon ring or one line component.
BEHAVIOR: Computes the nearest distance from _ptg to the specified part and returns the result in meters using geodetic coordinate system handling. The nearest projected point is written to _proj.
CONSTRAINTS: Requires a valid coordinate system. Returns -1 when the spatial reference is unavailable or invalid.