Boost logo

Geometry :

Subject: [ggl] Problem intersecting linestring & polygon in Xcode 3.2.2
From: Scott K Warren (scott)
Date: 2010-04-08 14:32:06


Hi,

I'm new to this list. I've decided to become an early adopter of Boost.Geometry and although I made a little progress, it wasn't long before I hit a speed bump and I'd like to ask for your help. I've looked into this problem myself but the template metaprogramming inside GGL is a little daunting and I'm stuck. (I'm an seasoned software developer and C++ programmer, but so far my experience with templates has been limited to straightforward use of things like STL and boost::smart_ptr. I apologize if this problem is my own fault or is something simple.)

I need to determine whether a linestring and a polygon intersect. I found exactly the code I need in "05_b_overlay_linestring_polygon_example", but it does not compile for me using Xcode 3.2.2. (I'm aware of the issue with Apple's 'check' macro and I don't think my problem is related to that. I have #undef'd it and still get compile errors on "05_b".)

Specifically, I get two error messages on the statement

    bg::get_turns<bg::detail::overlay::assign_null_policy>(ls, p,
            turns, bg::detail::get_turns::no_interrupt_policy());

which appears under the comment "Calculate intersection points (turn points)". The messages in brief are "invalid initialization of non-const reference of type no_interrupt_policy" and "in passing argument 4, apply is not a member of get_turns". I've appended the full text of the error messages below.

I am using the 1.42.0 release of Boost, but I also checked the sandbox in svn and as far as I can tell example 05_b has not been updated. Could my problem be caused by Xcode's gcc or Apple's headers?

I'd appreciate any hints you can give me on how to diagnose this. Thanks!

Also, thanks for your great work on GGL and for making it freely available to the rest of us.

Scott Warren

Full text of the error messages:

(a) invalid initialization of non-const reference of type 'boost::geometry::detail::get_turns::no_interrupt_policy&' from a temporary of type 'boost::geometry::detail::get_turns::no_interrupt_policy'

(b) in passing argument 4 of 'void boost::geometry::get_turns(const Geometry1&, const Geometry2&, Turns&, InterruptPolicy&) [with AssignPolicy = boost::geometry::detail::overlay::assign_null_policy, Geometry1 = boost::geometry::linestring_2d, Geometry2 = boost::geometry::polygon_2d, Turns = std::vector<boost::geometry::detail::overlay::turn_info<boost::geometry::point_xy<double, boost::geometry::cs::cartesian>, boost::geometry::detail::overlay::turn_operation, boost::array<boost::geometry::detail::overlay::turn_operation, 2ul> >, std::allocator<boost::geometry::detail::overlay::turn_info<boost::geometry::point_xy<double, boost::geometry::cs::cartesian>, boost::geometry::detail::overlay::turn_operation, boost::array<boost::geometry::detail::overlay::turn_operation, 2ul> > > >, InterruptPolicy = boost::geometry::detail::get_turns::no_interrupt_policy]',

'apply' is not a member of 'boost::geometry::dispatch::get_turns<boost::geometry::linestring_tag, boost::geometry::polygon_tag, false, false, boost::geometry::linestring<boost::geometry::point_xy<double, boost::geometry::cs::cartesian>, std::vector, std::allocator>, boost::geometry::polygon<boost::geometry::point_xy<double, boost::geometry::cs::cartesian>, std::vector, std::vector, true, std::allocator, std::allocator>, std::vector<boost::geometry::detail::overlay::turn_info<boost::geometry::point_xy<double, boost::geometry::cs::cartesian>, boost::geometry::detail::overlay::turn_operation, boost::array<boost::geometry::detail::overlay::turn_operation, 2ul> >, std::allocator<boost::geometry::detail::overlay::turn_info<boost::geometry::point_xy<double, boost::geometry::cs::cartesian>, boost::geometry::detail::overlay::turn_operation, boost::array<boost::geometry::detail::overlay::turn_operation, 2ul> > > >, boost::geometry::strategy::intersection::relate_cartesian_segments<boost::geometry::policies::relate::se
gments_tupled<boost::geometry::policies::relate::segments_intersection_points<boost::geometry::segment<const boost::geometry::point_xy<double, boost::geometry::cs::cartesian> >, boost::geometry::segment<const boost::geometry::point_xy<double, boost::geometry::cs::cartesian> >, boost::geometry::segment_intersection_points<boost::geometry::detail::overlay::turn_info<boost::geometry::point_xy<double, boost::geometry::cs::cartesian>, boost::geometry::detail::overlay::turn_operation, boost::array<boost::geometry::detail::overlay::turn_operation, 2ul> > >, void>, boost::geometry::policies::relate::segments_direction<boost::geometry::segment<const boost::geometry::point_xy<double, boost::geometry::cs::cartesian> >, boost::geometry::segment<const boost::geometry::point_xy<double, boost::geometry::cs::cartesian> >, void>, void>, void>, boost::geometry::detail::overlay::assign_null_policy, boost::geometry::detail::get_turns::no_interrupt_policy>'


Geometry list run by mateusz at loskot.net