User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.cursorfirst_integer_boolean_tgis_extent_string_tgis_shape_string_boolean

Table of Contents



TGIS_LayerVector.cursorFirst method

DK for Delphi | GisLayerVector.TGIS_LayerVector.cursorFirst | Constructors | Fields | Methods | Properties | Events

Initialize a cursor to the first shape matching extent, query, and DE-9IM spatial predicate filters.

Available also on: .NET | Java.

Syntax

// Delphi
protected
  procedure cursorFirst(
    const _cursor : Integer;
    const _viewerCS : Boolean;
    const _extent : TGIS_Extent;
    const _query : String;
    const _shape : TGIS_Shape;
    const _de9im : String;
    const _skipDeleted : Boolean
  ); virtual;
// C++ Builder
protected:
  virtual void cursorFirst(
    const int _cursor,
    const bool _viewerCS,
    TGIS_Extent* const _extent,
    const UnicodeString _query,
    TGIS_Shape* const _shape,
    const UnicodeString _de9im,
    const bool _skipDeleted
  );

Parameters

Name Type Description
_cursor Integer Cursor ID returned by cursorOpen(). The cursor is positioned at the first matching shape or at EOF if no shapes match.
_viewerCS Boolean If true, _extent is expressed in viewer coordinates. If false, _extent is expressed in layer coordinates.
_extent TGIS_Extent Spatial extent used for filtering candidate shapes.
_query String SQL (Structured Query Language)-like WHERE clause used for attribute filtering. An empty string disables attribute filtering.
_shape TGIS_Shape Optional reference shape used for DE-9IM (Dimensionally Extended 9-Intersection Model) spatial relation filtering.
_de9im String Spatial relation name or mask used with _shape. An empty string disables DE-9IM relation filtering.
_skipDeleted Boolean If true, soft-deleted shapes are excluded from the result set.

Remarks

PURPOSE: Begin filtered iteration over shapes in the vector layer. Supports spatial filtering by extent, attribute filtering by SQL-like expression, and topology-based filtering by DE-9IM relationship to another shape.

BEHAVIOR: Initializes cursor state, combines the supplied query with the layer scope when present, prepares topology testing for the reference shape, positions the cursor before the first candidate, and then advances until a shape satisfies visibility, query, deleted-shape, and optional relation filters.

USAGE: Start iterating shapes that match a spatial and attribute filter.

layer.cursorFirst(cursor, False, extent, query, shape, de9im,
True)
while not layer.cursorEof(cursor)
  ProcessShape(layer.cursorShape(cursor))

CONSTRAINTS: Invalid query syntax can raise an exception. Viewer-coordinate extents require the layer to be attached to a viewer with valid coordinate transformation context. Derived layers can override this method for custom or database-backed iteration.

2026/09/20 23:48

Page Tools