Boost C++ Libraries: Ticket #8363: Point-wise coordinate transformation? https://svn.boost.org/trac10/ticket/8363 <p> I have asked this question before – about a year ago. Just checking if there is any news in this regard: I would like to be able to apply a functor to every point in a multi-polygon, e.g., in order to transform an int-based polygon into a double-base polygon. This seems to be a canonical operation, like boost::adaptors::transform on ranges, and yet as far as I know there is no algorithm for this in geometry. This is how I currently do it: </p> <pre class="wiki">reserve( polygon.size() ); // vector of polygons for( std::vector&lt; _TPolygon&lt; S &gt;::polygon_type &gt;::const_iterator itp=polygon.begin(); itp!=polygon.end(); ++itp ) { emplace_back( polygon_type() ); back().outer().reserve( itp-&gt;outer().size() ); // vector of points describing polygon outline for( _TPolygon&lt; S &gt;::polygon_type::ring_type::const_iterator itouter=itp-&gt;outer().begin(); itouter!=itp-&gt;outer().end(); ++itouter ) { back().outer().emplace_back( _TPoint&lt; T &gt;(*itouter) ); } back().inners().reserve( itp-&gt;inners().size() ); // vector of holes for( _TPolygon&lt; S &gt;::polygon_type::inner_container_type::const_iterator itinners=itp-&gt;inners().begin(); itinners!=itp-&gt;inners().end(); ++itinners ) { back().inners().emplace_back( polygon_type::ring_type() ); back().inners().back().reserve( itinners-&gt;size() ); // vector of points describing a hole for( _TPolygon&lt; S &gt;::polygon_type::ring_type::const_iterator itinner=itinners-&gt;begin(); itinner!=itinners-&gt;end(); ++itinner ) { back().inners().back().emplace_back( _TPoint&lt; T &gt;(*itinner) ); } } } </pre><p> Is there an algorithm in geometry 1.52.0 that I did not find? Do you plan to add an algorithm for this task at some point? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8363 Trac 1.4.3 mkaravel Fri, 01 Aug 2014 20:41:21 GMT <link>https://svn.boost.org/trac10/ticket/8363#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8363#comment:1</guid> <description> <p> Have you tried using bg::convert? I have not tested it (yet), but for the specific problem you have it might just work. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>mkaravel</dc:creator> <pubDate>Fri, 01 Aug 2014 20:41:31 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/8363#comment:2 https://svn.boost.org/trac10/ticket/8363#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">mkaravel</span> added </li> </ul> Ticket Volker Schöch <vschoech@…> Wed, 19 Nov 2014 11:27:40 GMT <link>https://svn.boost.org/trac10/ticket/8363#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8363#comment:3</guid> <description> <p> Thank you very much for your comment. Indeed, I can simply replace my code by a call to boost::geometry::convert(...). I tested it for 1.57.0. The ticket can be closed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>mkaravel</dc:creator> <pubDate>Wed, 27 May 2015 06:42:22 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8363#comment:4 https://svn.boost.org/trac10/ticket/8363#comment:4 <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">invalid</span> </li> </ul> Ticket mkaravel Wed, 27 May 2015 06:43:25 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/8363#comment:5 https://svn.boost.org/trac10/ticket/8363#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">invalid</span> </li> </ul> Ticket mkaravel Wed, 27 May 2015 06:44:11 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8363#comment:6 https://svn.boost.org/trac10/ticket/8363#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> Ticket