Boost logo

Geometry :

Subject: [ggl] Polygon DP simplification
From: Barend Gehrels (barend)
Date: 2011-10-07 09:41:43


On 30-9-2011 19:56, V D wrote:
> Hi,
> I'm trying to supply my own strategy to work around the problem for now.
> Using the same code as before, except now I'm trying:
> 27 typedef boost::geometry::strategy::distance::pythagoras<point_xy,
> point_xy, double> dist_strat;
> 28 typedef
> boost::geometry::strategy::simplify::douglas_peucker<point_xy,
> dist_strat > simp_strat;
> 30 simp_strat my_simplify_strat_test;
> 31 boost::geometry::simplify(original_1, simplified_1, 1.0 / 2048.0,
> my_simplify_strat_test);
> But I cannot get the strategy to compile, I get a pretty nasty compile
> error :

The Douglas Peucker strategy expects a point-to-segment distance
strategy. I'm happy to say that this is documented ;-)

So the next lines will compile:

     typedef boost::geometry::strategy::distance::pythagoras<point_xy,
point_xy, double> dist_strat;
boost::geometry::strategy::distance::projected_point<point_xy, point_xy,
double, dist_strat> pp_dist_strat;
pp_dist_strat> simp_strat;
     simp_strat my_simplify_strat_test;

     // etc

However, this change would not have solved the problem, because the now
commented line would have taken the accompagnying comparable strategy

Regards, Barend

-------------- next part --------------
An HTML attachment was scrubbed...

Geometry list run by mateusz at