User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_shape.distance_tgis_point_double

Table of Contents

TGIS_Shape.Distance method

DK11 for Delphi | GisLayerVector.TGIS_Shape.Distance | Constructors | Fields | Methods | Properties

Calculate planar distance between a point and the shape.

Available also on: .NET | Java | ActiveX.

Syntax

// Delphi
public
  function Distance(
    const _ptg : TGIS_Point;
    const _prec : Double
  ) : Double; virtual;
// C++ Builder
public:
  virtual double Distance(
    TGIS_Point* const _ptg,
    const double _prec
  );

Parameters

Name Type Description
_ptg TGIS_Point reference point
_prec Double precision /not longer distance than/; point inside the polygon is always not greater then _prec; if _prec less than 0, then being outside/inside polygon means the same;

Result

Type Description
Double Distance between shapes in map units.

Example

Delphi

var
  _shape : TGIS_Shape;
  x : Double;
  pkt : TGIS_Point;
 
  pkt.X:=10;
  pkt.Y:=10;
 
  // calculate a distance
  x:=_shape.Distance(pkt,20);
2020/05/07 01:09

Page Tools