User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.locate_tgis_point_double

Table of Contents

TGIS_LayerVector.Locate(TGIS_Point; Double) method

DK11 for Delphi | GisLayerVector.TGIS_LayerVector.Locate | Overloads | Constructors | Fields | Methods | Properties | Events

Locate a shape.

Available also on: .NET | Java | ActiveX.

Syntax

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

Parameters

Name Type Description
_ptg TGIS_Point reference point /searching point/; if the layer has been attached to the Viewer then expected _ptg units are in a Viewer coordinate space; otherwise expected _ptg units are in a Layer coordinate space
_prec Double precision /not a longer distance than/; for points inside the polygon (if _prec >= 0) the distance will be multiply by 0.95 (to prefer points inside the polygon) but will not be bigger then _prec; for point distance will be multiplied by 0.9 to prefer points over lines and polygons _prec units are calculated same way as _ptg

Result

Type Description
TGIS_Shape Found shape or nil.

Remarks

Use this method to locate a shape that is closest to point _ptg but also on _prec distance. Internally it calls LocateEx method. If locate is called upon active paint operations then result could be null. But Locate and paint process are using the same vector enumerator context.

It is recommended to check InPaint property before calling this Locate.

2018/02/17 00:09