1
我需要确定两个几何体的内部是否相交。一个InteriorsIntersect谓语不被OGC或升压几何规定,而是由DE-9IM矩阵(see also)定义:Boost几何体内用户定义的空间谓词
T * *
* * *
* * *
我已经使用升压几何的relate
功能创建了自己的谓语。
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。我唯一担心的是relate
函数和static_mask
类型没有作为Boost Geometry API的一部分记录下来,并且就我所知道的实现细节而言。以这种方式使用relate
安全吗?使用Boost几何实现相同的目标是否有其他选择?理想情况下,我希望relate
是boost/geometry/algorithms
内的算法。