Boost C++ Libraries: Ticket #11232: User defined spatial predicate within Boost Geometry https://svn.boost.org/trac10/ticket/11232 <p> I need to determine whether the interiors of two geometries intersect. An <a class="missing wiki">InteriorsIntersect</a> predicate is not specified by OGC or Boost Geometry but is defined by the DE-9IM matrix: </p> <pre class="wiki"> T * * * * * * * * </pre><p> I've created my own predicate using the relate function in Boost Geometry. </p> <pre class="wiki">namespace bgr = boost::geometry::detail::relate; using InteriorsIntersectMask = bgr::static_mask&lt;'T','*','*','*','*','*','*','*','*'&gt;; template&lt;typename Geom1, typename Geom2&gt; inline bool interiorsIntersect(const Geom1&amp; geom1, const Geom2&amp; geom2) { return bgr::relate&lt;InteriorsIntersectMask&gt;(geom1, geom2); } </pre><p> 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. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11232 Trac 1.4.3 awulkiew Tue, 26 May 2015 15:38:46 GMT milestone changed https://svn.boost.org/trac10/ticket/11232#comment:1 https://svn.boost.org/trac10/ticket/11232#comment:1 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.59.0</span> </li> </ul> <p> Yes, this was planned some time ago already. This is a <a class="missing wiki">GitHub</a> pull request with the change: <a class="ext-link" href="https://github.com/boostorg/geometry/pull/288"><span class="icon">​</span>https://github.com/boostorg/geometry/pull/288</a> </p> <p> The interface is the same for run-time and compile-time masks. </p> <pre class="wiki">namespace bg = boost::geometry; using InteriorsIntersectMask = bg::de9im::static_mask&lt;'T','*','*','*','*','*','*','*','*'&gt;; bg::relate(geom1, geom2, InteriorsIntersectMask()); </pre><p> Does it satisfy your needs? </p> Ticket Frank Hippmann <frank.hippmann@…> Tue, 26 May 2015 20:24:21 GMT <link>https://svn.boost.org/trac10/ticket/11232#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11232#comment:2</guid> <description> <p> Thanks, that's exactly what I am after. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>awulkiew</dc:creator> <pubDate>Wed, 27 May 2015 13:42:48 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11232#comment:3 https://svn.boost.org/trac10/ticket/11232#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket