User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.loop_void

Table of Contents

TGIS_LayerVector.Loop method

DK11 for Delphi | GisLayerVector.TGIS_LayerVector.Loop | Overloads | Constructors | Fields | Methods | Properties | Events

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

Available also on: .NET | Java | ActiveX.

Syntax

// Delphi
public
  function Loop : TGIS_LayerVectorEnumeratorFactory; overload; virtual;
// C++ Builder
public:
  virtual TGIS_LayerVectorEnumeratorFactory* Loop(void) /* overload */;

Result

Type Description
TGIS_LayerVectorEnumeratorFactory Shape enumerator'

Example

Delphi

// 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 ;

C++ Builder

// 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;

References

2019/08/13 10:50