Boost logo

Geometry :

Subject: Re: [geometry] R-tree segment query optimization
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2018-04-26 17:11:31


Hi Jeremy,

Jeremy Murphy Via Geometry wrote:
> I do have the code on GitHub now if you have time and inclination to
> take a look: https://github.com/jeremy-murphy/concave_hull
>

The most simple solution I found for now is to place forward
declarations of hemisphere and your intersects() overloads before
#include<boost/geometry.hpp>, so:

#include <boost/geometry/geometries/box.hpp>

namespace boost { namespace geometry {
namespace model {
 Â Â Â  template <typename Point>
 Â Â Â  struct hemisphere;
}
 Â Â Â  template <typename Point, typename HemispherePoint>
 Â Â Â  inline bool intersects(Point const& p,
model::hemisphere<HemispherePoint> const& hs);

 Â Â Â  template <typename Point, typename HemispherePoint>
 Â Â Â  inline bool intersects(model::box<Point> const& b,
model::hemisphere<HemispherePoint> const& hs);
}}

#include <boost/geometry.hpp>

// the rest as it is in the file hemisphere.hpp

Note that hemisphere doesn't have to be defined in the bg::model
namespace and that traits are not needed.

Adam

P.S. you have a bug here:
https://github.com/jeremy-murphy/concave_hull/blob/master/hemisphere.hpp#L48
You're passing a point to a 2-argument set() function which is used for
segments and boxes. Either remove the first argument or pass segment
instead of a point.



Geometry list run by mateusz at loskot.net