DK11 for Delphi | GisLayerVector.TGIS_LayerVector.Loop | Overloads | Constructors | Fields | Methods | Properties | Events
Prepares enumerator (also known as iterator or cursor) to iterate the layer.
// Delphi public function Loop( const _extent : TGIS_Extent; const _query : String ) : TGIS_LayerVectorEnumeratorFactory; overload; virtual;
// C++ Builder public: virtual TGIS_LayerVectorEnumeratorFactory* Loop( TGIS_Extent* const _extent, const UnicodeString _query ) /* overload */;
Name | Type | Description |
---|---|---|
_extent | TGIS_Extent | extent of items to be found; expected _extent units are in a Layer coordinate space |
_query | String | query which must be matched by item; closely mimics SQL WHERE clause; for examples you can use 'AGE >= 18'; empty (default) means that no items will match. |
Type | Description |
---|---|
TGIS_LayerVectorEnumeratorFactory | Shape itself or nil. |
// Indirect use var shp : TGIS_Shape ; begin // automated enumerators for shp in layer.Loop( some_extent, 'POPULATION>100000 AND AREA>50333' ) do begin dosomething(); end ; end ; // Direct enumerator use var shp : TGIS_Shape ; en : TGIS_LayerVectorEnumerator ; begin en := layer.Loop( some_extent, 'POPULATION>100000 AND AREA>50333' ).GetEnumerator ; while en.MoveNext do begin shp := en.GetCurrent ; dosomething(); end ; en.Free ; end ;
// Indirect use // Indirect use is not possible due to C++ limitation // Direct enumerator use TGIS_LayerVectorEnumerator *en; en = layer->Loop(some_extent,"POPULATION>100000 AND AREA>50333")->GetEnumerator() ; while (en->MoveNext()) { shp = en->Current; dosomething(); } delete en;