Boost logo

Geometry :

Subject: [ggl] Polygon DP simplification
From: Mateusz Loskot (mateusz)
Date: 2011-10-05 07:48:59


On 05/10/11 00:35, V D wrote:
> Hi,
>
> Anyone had any luck specifying a distance strategy to DP ?

I have tried, quickly and with no luck.

Apparently, something weird is going on around the distance:pythagoras
definitions. The following example works as expected:

/////////////////////////////////////////////////////////
namespace bg = boost::geometry;

typedef bg::strategy::distance::projected_point
    <point_xy, point_xy> distance_strategy_type;
typedef bg::strategy::simplify::douglas_peucker
    <point_xy, distance_strategy_type> simplify_strategy_type;

BOOST_CONCEPT_ASSERT((bg::concept::SimplifyStrategy<simplify_strategy_type>));

bg::simplify(original_1, simplified_1, 1.0 / 2048.0,
simplify_strategy_type());
/////////////////////////////////////////////////////////

However, replacing
typedef bg::strategy::distance::projected_point
with
typedef bg::strategy::distance::pythagoras
causes compilation errors.

Both, projected_point and pythagoras are supposed to be equally valid
citizens here, but the latter seems to be misdefined as it does not
fulfil the concept definition.

Perhaps there is a reason for that, but I lack of background information
here. So, I'd suggest to wait for Barend.

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org

Geometry list run by mateusz at loskot.net