Boost logo

Boost :

Subject: Re: [boost] Final report of GSOC project 'Spatial Indexes'
From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2008-09-16 12:02:22


On Thu, Sep 11, 2008 at 2:41 PM, Federico J. Fernández
<federico.fernandez_at_[hidden]> wrote:
>
> - Build a Quadtree.
> - Build an rTree.
> - Integrate some previous work from a former GSoC project of a k-d-tree.
> - Test and document everything.

When you do rectangle queries, I think you should use an output
iterator rather than returning a deque like you do in this line from
your tutorial:

geometry::box<geometry::point_xy<double> > query_box(
    geometry::point_xy<double>(0.0, 0.0),
    geometry::point_xy<double>(5.0, 5.0));
std::deque< std::vector<std::string>::iterator > d = q.find(query_box);

One, that is a rather heavy return type. Two, you're exposing an
implementation detail. I find the following much nicer:

geometry::box<geometry::point_xy<double> > query_box(
    geometry::point_xy<double>(0.0, 0.0),
    geometry::point_xy<double>(5.0, 5.0));
std::vector< std::vector<std::string>::iterator > d;
q.find(query_box, std::back_inserter(d));

I haven't looked at the code, only the docs, so please excuse me if
this functionality already exists.

--Michael Fawcett


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk