Subject: [Boost-bugs] [Boost C++ Libraries] #11233: User defined spatial predicate within Boost Geometry
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-04-24 03:49:05
#11233: User defined spatial predicate within Boost Geometry
-----------------------------------------------+---------------------------
Reporter: Frank Hippmann <frank.hippmann@â¦> | Owner: barendgehrels
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: geometry
Version: Boost 1.56.0 | Severity: Problem
Keywords: geometry relate |
-----------------------------------------------+---------------------------
I need to determine whether the interiors of two geometries intersect. An
InteriorsIntersect predicate is not specified by OGC or Boost Geometry but
is defined by the DE-9IM matrix:
{{{
T * *
* * *
* * *
}}}
I've created my own predicate using the relate function in Boost Geometry.
{{{
namespace bgr = boost::geometry::detail::relate;
using InteriorsIntersectMask =
bgr::static_mask<'T','*','*','*','*','*','*','*','*'>;
template<typename Geom1, typename Geom2>
inline bool interiorsIntersect(const Geom1& geom1, const Geom2& geom2)
{
return bgr::relate<InteriorsIntersectMask>(geom1, geom2);
}
}}}
This works great. My only concern is that the relate function and
static_mask type are not documented as part of the Boost Geometry API and
are implementation details as far as I can tell. Is it safe to use relate
in this way? Is there an alternative to achieving the same goal using
Boost Geometry? Ideally I would like to see relate be an algorithm within
boost/geometry/algorithms.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11233> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC