Finds the first occurrence of an item which meets an extent and query. Will use RTree if available.
// Delphi public function FindFirst( const _extent : TGIS_Extent; const _query : String ) : TGIS_Shape; overload; virtual;
// C++ Builder public: virtual TGIS_Shape* FindFirst( TGIS_Extent* const _extent, const UnicodeString _query ) /* overload */;
|_extent||TGIS_Extent||extent of items to be found; the layer has been attached to the Viewer then expected _extent units are in a Viewer coordinate space; otherwise 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.|
|TGIS_Shape||Shape itself or nil.|
Use this method to find to the first shape in the layer matching given criteria. Using _query param we can narrow the result of the shape searching down to the minimum. This should speed up our process of locating a desired shape.
To locate a shape, simply choose an existing layer and use FindFirst method of with a proper extent and a SQL query as a WHERE clause.