User Tools

Site Tools


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

TGIS_LayerVector.Loop(TGIS_Extent, string, TGIS_Shape, string, bool) method

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

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

Available also on: Delphi | Java | ActiveX.

Syntax

// C#
public TGIS_LayerVectorEnumeratorFactory Loop(
  TGIS_Extent _extent,
  string _query,
  TGIS_Shape _shape,
  string _de9im,
  bool _skipDeleted
);
' VisualBasic
Public Function Loop(
  ByVal _extent As TGIS_Extent,
  ByVal _query As String,
  ByVal _shape As TGIS_Shape,
  ByVal _de9im As String,
  ByVal _skipDeleted As Boolean
) As TGIS_LayerVectorEnumeratorFactory
// Oxygene
public
  function Loop(
    _extent : TGIS_Extent;
    _query : String;
    _shape : TGIS_Shape;
    _de9im : String;
    _skipDeleted : Boolean
  ) : TGIS_LayerVectorEnumeratorFactory; virtual;

Parameters

Name Type Description
_extent TGIS_Extent extent of items to be found; expected _extent units are in a Layer coordinate space
_query string
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.
_shape TGIS_Shape if not nil, then only shapes matched _de9im matrix with _shape will be found
_de9im string
String
DE-9IM matrix of comparison
_skipDeleted bool
Boolean
set a skip deleted treatment; by default deleted items will be ignored

Result

Type Description
TGIS_LayerVectorEnumeratorFactory Shape itself or nil.

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

2019/08/13 10:54