query method

  1. @override
List query(
  1. Envelope? searchEnv
)
override

Queries the tree and returns items which may lie in the given search envelope. Precisely, the items that are returned are all items in the tree whose envelope may intersect the search Envelope. Note that some items with non-intersecting envelopes may be returned as well; the client is responsible for filtering these out. In most situations there will be many items in the tree which do not intersect the search envelope and which are not returned - thus providing improved performance over a simple linear scan.

@param searchEnv the envelope of the desired query area. @return a List of items which may intersect the search envelope

Implementation

@override
List<dynamic> query(Envelope? searchEnv) {
  ///
  /// the items that are matched are the items in quads which
  /// overlap the search envelope
  ///
  ArrayListVisitor visitor = new ArrayListVisitor();
  queryWithVisitor(searchEnv, visitor);
  return visitor.getItems();
}