Any spatial index (or space partinioning data structure) would do it
the same way. Indexing would be done using some bounding regions,
not polygons, for fast pruning. Then the searching for the nearest
Polygon would be done similar way as I described above. If the data
structure allowed to store Polygons the above procedure would be
done internally.
What do you mean by "keep increasing the size"? I didn't mention it
explicitly but you could pass rtree.size() or some big number (as
k-number of nearest elements) to the nearest predicate passed to the
qbegin(). Then the query iterator would iterate over all of the
elements stored in the rtree, the nearest ones first. You then would
be able to stop iteration at some point - after it'd be not possible
to find a closer Polygon, when a bounding box was further than the
nearest distance. So if the data was sparsely distributed it'd
require 2 iterations.
Regards,
Adam