Boost logo

Geometry :

Subject: [geometry] one-line bug in algorithms/distance.hpp
From: Menelaos Karavelas (menelaos.karavelas_at_[hidden])
Date: 2013-11-01 09:11:34


Hello all.

I tried to compile the attached simple program to compute the distance between a linestring and a point while passing a strategy. I am using boost 1.54.0.

The compilation failed due to the last call to distance. The problem is that in line 401 of algorithms/distance.hpp, the compiler tries to define the pp_strategy_type via the typedef:
        typedef typename Strategy::point_strategy_type pp_strategy_type;
(where Strategy is the projected_point strategy), but the type point_strategy_type is not defined in the projected_point class.
The fix to this is easy. Replace the above line by:
        typedef typename strategy::distance::services::strategy_point_point<Strategy>::type pp_strategy_type.

All the best,

- m.

P.S. One could define the missing type in the projected_point class, but I find the solution above more elegant...




Geometry list run by mateusz at loskot.net