GeoEco.Datasets.SelectCursor

class GeoEco.Datasets.SelectCursor(dataset, fields, where, orderBy, rowCount, reportProgress, rowDescriptionSingular, rowDescriptionPlural)

Bases: _Cursor

Base class for forward-only cursors used to read rows from a Table.

This class is not meant to be instantiated directly. Instead call Table.OpenSelectCursor(). After obtaining a SelectCursor instance, call NextRow() to advance the cursor to the first row. If NextRow() returns True, use GetValue() and GetGeometry() to access fields of the row and its geometry. Call NextRow() again to advance to the next row. When NextRow() returns False, no rows remain and the cursor is closed. The cursor is also closed automatically if the SelectCursor instance is deleted, and you can explicitly close it with Close().

The typical pattern for using SelectCursor looks like this:

with table.OpenSelectCursor(...) as cursor:
    while cursor.NextRow():
        value = cursor.GetXXXXX(...)
        ...

Properties

property AtEnd

(bool) If True, no more rows are available (and IsOpen will also be False). If False, more rows may be available. Read only.

property IsOpen

(bool) True if the cursor is open, False if it is closed. Read only.

property RowDescriptionPlural

(str) Word to use in progress and error messages for plural rows. If not supplied when the cursor was opened, an appropriate generic word will be automatically selected based on table’s geometry type, such as “points”, “lines”, “polygons”, and so on. If the table does not have geometry, “rows” will be used. Read only. Minimum length꞉ 1.

property RowDescriptionSingular

(str) Word to use in progress and error messages for a single row. If not supplied when the cursor was opened, an appropriate generic word will be automatically selected based on the table’s geometry type, such as “point”, “line”, “polygon”, and so on. If the table does not have geometry, “row” will be used. Read only. Minimum length꞉ 1.

property Table

(Table) Table the cursor is accessing. Read only.

Methods

Close

Closes the cursor.

GetGeometry

Retrieves the geometry of the current row.

GetOID

Retrieves the ArcGIS "object ID" of the current row.

GetValue

Retrieves the value of a field of the current row, given the name of the field.

NextRow

Advances the cursor to the next row.

SetRowCount

Sets the number of rows that this cursor is expected to process.