User Tools

Site Tools


api:dk11:net:tatukgis.ndk.tgis_layervector.loop_void

Table of Contents

TGIS_LayerVector.Loop method

DK11 for .NET | TatukGIS.NDK.TGIS_LayerVector.Loop | Overloads | Constructors | Fields | Methods | Properties | Events

Prepares enumerator (also known as iterator or cursor) to iterate the layer.

Available also on: Delphi | Java | ActiveX | Python.

Syntax

// C#
public virtual TGIS_LayerVectorEnumeratorFactory Loop();
' VisualBasic
Public Overridable Function Loop() As TGIS_LayerVectorEnumeratorFactory
// Oxygene
public
  function Loop : TGIS_LayerVectorEnumeratorFactory; virtual;

Result

Type Description
TGIS_LayerVectorEnumeratorFactory Shape enumerator'

Example

C#

// Indirect use
foreach (shp in layer.Loop( some_extent, "POPULATION>100000 AND AREA>50333") )
{
  dosomething();
}
 
// Direct enumerator use
TGIS_LayerVectorEnumerator en ;
en = layer.Loop( some_extent, "POPULATION>100000 AND AREA>50333").GetEnumerator() ;
while (en.MoveNext())
{
  shp = en.GetCurrent();
  dosomething();
}
en.Dispose() ; 

VisualBasic

'Indirect use
For Each shp In layer.Loop( some_extent, "POPULATION>100000 AND AREA>50333") )
  dosomething()
Next
 
'Direct enumerator use
Dim en As TGIS_LayerVectorEnumerator
en = layer.Loop( some_extent, "POPULATION>100000 AND AREA>50333").GetEnumerator()
While (en.MoveNext())
  shp = en.GetCurrent()
  dosomething()
End While
en.Dispose() ; 

References

2023/02/24 20:47

Page Tools