User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.findnext_void

Table of Contents

TGIS_LayerVector.FindNext method

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

Finds the next occurrence of an item defined in FindFirst. Method will use RTree if available.

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

Syntax

// Delphi
public
  function FindNext : TGIS_Shape; virtual;
// C++ Builder
public:
  virtual TGIS_Shape* FindNext(void);

Result

Type Description
TGIS_Shape Shape itself or nil.

Remarks

See: FindFirst

Use this method to find the next shape in the layer matching given criteria. We can move between shapes by doing custom operations on them.

Example

Delphi

procedure MyClass.FindNextShape();
var
   ll   : TGIS_LayerVector ;
   ex   : TGIS_Extent ;
   shp  : TGIS_Shape;
   i : Integer;
   criteria : String;
begin
   // set a visible extent to full 
   GIS.FullExtent;
   ex := GIS.VisibleExtent;
 
   // locate shapes matching given criteria on all layers
   for i:=0 to GIS.Items.Count-1 do begin
       ll :=  GIS.Items[i];
 
       // our criteria
       criteria:='POPULATION>100000 AND AREA>50333';
 
       // find a first shape in given extent
       shp:=ll.FindFirst (ex,criteria);
 
       // using FindNext method we can locate other shapes
       // any found shape will have its area color changed
       while assigned( shp ) do begin
         shp := shp.MakeEditable;
         shp.Params.Area.Color:=clBlue;
         shp := ll.FindNext ;
       end;
   end;
end;

References

2024/12/20 22:19

Page Tools