Available also on: Delphi | .NET | Java | ActiveX.
Locates the nearest shape to a reference point within the specified tolerance distance.
# Python def Locate( self, _ptg: TGIS_Point, _prec: float ) -> TGIS_Shape:
| 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 | float | Maximum search distance. Shapes farther than this tolerance are not returned. |
| Type | Description |
|---|---|
| TGIS_Shape | The nearest matching shape, or nil if no shape is found within the specified tolerance. |
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.