GeoEco.Datasets.SelectCursor
- class GeoEco.Datasets.SelectCursor(dataset, fields, where, orderBy, rowCount, reportProgress, rowDescriptionSingular, rowDescriptionPlural)
Bases:
_CursorBase 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 aSelectCursorinstance, callNextRow()to advance the cursor to the first row. IfNextRow()returns True, useGetValue()andGetGeometry()to access fields of the row and its geometry. CallNextRow()again to advance to the next row. WhenNextRow()returns False, no rows remain and the cursor is closed. The cursor is also closed automatically if theSelectCursorinstance is deleted, and you can explicitly close it withClose().The typical pattern for using
SelectCursorlooks like this:with table.OpenSelectCursor(...) as cursor: while cursor.NextRow(): value = cursor.GetXXXXX(...) ...
Properties
- property AtEnd
(
bool) If True, no more rows are available (andIsOpenwill also be False). If False, more rows may be available. 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.
Methods
Closes the cursor.
Retrieves the geometry of the current row.
Retrieves the ArcGIS "object ID" of the current row.
Retrieves the value of a field of the current row, given the name of the field.
Advances the cursor to the next row.
Sets the number of rows that this cursor is expected to process.