Boost logo

Geometry :

Subject: Re: [geometry] Compile Error with douglas peucker
From: Stephan Menzel (stephan.menzel_at_[hidden])
Date: 2015-01-03 12:43:17


May I humbly bump this...

I have a standanlone cpp file attached for your convenience but it's really
just those lines...

Thank you for your consideration.

Stephan

On Tue, Dec 9, 2014 at 11:17 AM, Stephan Menzel <stephan.menzel_at_[hidden]>
wrote:

> Hello,
>
> I am trying to port existing and working code from 1.54 to above and ever
> since 1.55 there's a compile error on both gcc and VC9 here:
>
> typedef boost::geometry::model::point<double, 3,
> boost::geometry::cs::cartesian> Point;
> typedef
> boost::geometry::model::box<Point>
> BoundingBox;
> typedef
> boost::geometry::model::segment<Point>
> Segment;
> typedef
> boost::geometry::model::linestring<Point>
> LineString;
>
> // LineString raw is being filled
> LineString ret;
>
> typedef boost::geometry::strategy::distance::projected_point<Point>
> PointSegmentDistanceStrategy;
> typedef boost::geometry::strategy::simplify::douglas_peucker<Point,
> PointSegmentDistanceStrategy> SimplificationStrategy;
> SimplificationStrategy strat;
> boost::geometry::simplify<LineString, double,
> SimplificationStrategy>(raw, ret, 20, strat);
>
> The error appears to be different in 1.57.
>
> GCC says:
>
> In file included from
> /home/sm/devel/boost_1_57_0/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp:31:0,
> from
> /home/sm/devel/boost_1_57_0/boost/geometry/algorithms/buffer.hpp:32,
> from
> /home/sm/devel/boost_1_57_0/boost/geometry/geometry.hpp:48,
> from /home/sm/devel/boost_1_57_0/boost/geometry.hpp:17,
> from /home/sm/devel/ogre/DouglasPeucker.hpp:4,
> from /home/sm/devel/ogre/DouglasPeucker.cpp:1:
> /home/sm/devel/boost_1_57_0/boost/geometry/algorithms/simplify.hpp: In
> instantiation of 'static void
> boost::geometry::detail::simplify::simplify_range_insert::apply(const
> Range&, OutputIterator, const Distance&, const Strategy&) [with Range =
> boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> >; Strategy =
> boost::geometry::strategy::simplify::douglas_peucker<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian>,
> boost::geometry::strategy::distance::projected_point<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >; OutputIterator =
> std::back_insert_iterator<boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >; Distance = double]':
> /home/sm/devel/boost_1_57_0/boost/geometry/algorithms/simplify.hpp:112:17:
> required from 'static void
> boost::geometry::detail::simplify::simplify_range<Minimum>::apply(const
> Range&, Range&, const Distance&, const Strategy&) [with Range =
> boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> >; Strategy =
> boost::geometry::strategy::simplify::douglas_peucker<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian>,
> boost::geometry::strategy::distance::projected_point<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >; Distance = double; long unsigned
> int Minimum = 2ul]'
> /home/sm/devel/boost_1_57_0/boost/geometry/algorithms/simplify.hpp:309:82:
> required from 'static void
> boost::geometry::resolve_strategy::simplify::apply(const Geometry&,
> Geometry&, const Distance&, const Strategy&) [with Geometry =
> boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> >; Distance = double; Strategy =
> boost::geometry::strategy::simplify::douglas_peucker<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian>,
> boost::geometry::strategy::distance::projected_point<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >]'
> /home/sm/devel/boost_1_57_0/boost/geometry/algorithms/simplify.hpp:395:80:
> required from 'static void
> boost::geometry::resolve_variant::simplify<Geometry>::apply(const
> Geometry&, Geometry&, const Distance&, const Strategy&) [with Distance =
> double; Strategy =
> boost::geometry::strategy::simplify::douglas_peucker<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian>,
> boost::geometry::strategy::distance::projected_point<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >; Geometry =
> boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> >]'
> /home/sm/devel/boost_1_57_0/boost/geometry/algorithms/simplify.hpp:463:85:
> required from 'void boost::geometry::simplify(const Geometry&, Geometry&,
> const Distance&, const Strategy&) [with Geometry =
> boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> >; Distance = double; Strategy =
> boost::geometry::strategy::simplify::douglas_peucker<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian>,
> boost::geometry::strategy::distance::projected_point<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >]'
> /home/sm/devel/ogre/DouglasPeucker.cpp:113:91: required from here
> /home/sm/devel/boost_1_57_0/boost/geometry/algorithms/simplify.hpp:61:13:
> error: no matching function for call to
> 'boost::geometry::strategy::simplify::douglas_peucker<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian>,
> boost::geometry::strategy::distance::projected_point<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >::apply(const
> boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> >&,
> std::back_insert_iterator<boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >&, const double&) const'
> strategy.apply(range, out, max_distance);
> ^
> /home/sm/devel/boost_1_57_0/boost/geometry/algorithms/simplify.hpp:61:13:
> note: candidate is:
> In file included from
> /home/sm/devel/boost_1_57_0/boost/geometry/strategies/strategies.hpp:72:0,
> from
> /home/sm/devel/boost_1_57_0/boost/geometry/geometry.hpp:43,
> from /home/sm/devel/boost_1_57_0/boost/geometry.hpp:17,
> from /home/sm/devel/ogre/DouglasPeucker.hpp:4,
> from /home/sm/devel/ogre/DouglasPeucker.cpp:1:
> /home/sm/devel/boost_1_57_0/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp:275:34:
> note: static OutputIterator
> boost::geometry::strategy::simplify::douglas_peucker<Point,
> PointDistanceStrategy>::apply(const Range&, OutputIterator,
> boost::geometry::strategy::simplify::douglas_peucker<Point,
> PointDistanceStrategy>::distance_type) [with Range =
> boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> >; OutputIterator =
> std::back_insert_iterator<boost::geometry::model::linestring<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >; Point =
> boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>;
> PointDistanceStrategy =
> boost::geometry::strategy::distance::projected_point<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> >;
> boost::geometry::strategy::simplify::douglas_peucker<Point,
> PointDistanceStrategy>::distance_type =
> boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>]
> static inline OutputIterator apply(Range const& range,
> ^
> /home/sm/devel/boost_1_57_0/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp:275:34:
> note: no known conversion for argument 3 from 'const double' to
> 'boost::geometry::strategy::simplify::douglas_peucker<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian>,
> boost::geometry::strategy::distance::projected_point<boost::geometry::model::point<double,
> 3ul, boost::geometry::cs::cartesian> > >::distance_type {aka
> boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian>}'
>
>
> I didn't notice any change in interface that would explain this so I
> suppose it could be a bug in geometry.
>
>
> Any ideas?
>
> Cheers,
> Stephan
>





Geometry list run by mateusz at loskot.net