Boost logo

Geometry :

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


Hi,

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 ;-)
<http://www.boost.org/doc/libs/1_47_0/libs/geometry/doc/html/geometry/reference/strategies/strategy_simplify_douglas_peucker.html>

So the next lines will compile:

     typedef boost::geometry::strategy::distance::pythagoras<point_xy,
point_xy, double> dist_strat;
     typedef
boost::geometry::strategy::distance::projected_point<point_xy, point_xy,
double, dist_strat> pp_dist_strat;
     typedef
boost::geometry::strategy::simplify::douglas_peucker<point_xy,
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
instead...

Regards, Barend

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20111007/94869d1b/attachment.html


Geometry list run by mateusz at loskot.net