User Tools

Site Tools


api:dk11:net:tatukgis.ndk.tgis_layervector.locate_tgis_point_double

Table of Contents

TGIS_LayerVector.Locate(TGIS_Point, double) method

DK for .NET | TatukGIS.NDK.TGIS_LayerVector.Locate | Overloads | Constructors | Fields | Methods | Properties | Events

Locates the nearest shape to a reference point within the specified tolerance distance.

Available also on: Delphi | Java | ActiveX | Python.

Syntax

// C#
public virtual TGIS_Shape Locate(
  TGIS_Point _ptg,
  double _prec
);
' VisualBasic
Public Overridable Function Locate(
  ByVal _ptg As TGIS_Point,
  ByVal _prec As Double
) As TGIS_Shape
// Oxygene
public
  function Locate(
    _ptg : TGIS_Point;
    _prec : Double
  ) : TGIS_Shape; virtual;

Parameters

Name Type Description
_ptg TGIS_Point Reference point used for the search. The coordinate space depends on the caller context and layer/viewer usage.
_prec double
Double
Maximum search distance. Shapes farther than this tolerance are not returned.

Result

Type Description
TGIS_Shape The nearest matching shape, or nil if no shape is found within the specified tolerance.

Remarks

PURPOSE: Supports interactive hit testing for vector features such as points, arcs/lines, and polygons.

BEHAVIOR: Searches candidate shapes near _ptg and returns the closest match within _prec. The search can use the layer's spatial index when available for faster lookup.

CONSTRAINTS: Distance is evaluated in the coordinate space supplied to the method. Results depend on the layer's current visibility and filtering rules.

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.

2026/07/11 01:06

Page Tools