|
Geometry : |
Subject: [ggl] Polygon DP simplification
From: Mateusz Loskot (mateusz)
Date: 2011-09-30 09:17:43
On 30/09/11 03:47, V D wrote:
> Hum, if the problem is with the pythagoras distance, why is the
> following snippet returning the expected value, 5.0.
> Given the current error in the source, shouldn't it return 25 ?
>
> #include <boost/geometry.hpp>
> #include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
> #include <boost/geometry/geometries/point_xy.hpp>
> #include <iostream>
>
> int main()
> {
> typedef boost::geometry::model::d2::point_xy<double> point_xy;
>
> point_xy p1(0.0, 0.0);
> point_xy p2(5.0, 0.0);
>
> boost::geometry::strategy::distance::pythagoras<point_xy, point_xy,
> double> my_strategy;
> std::cout << boost::geometry::distance(p1,p2, my_strategy) << std::endl;
>
> return 0;
> }
>
>
> Is it only in the use of DP simplification that the pythagoras strategy
> is problematic ?
The difference is in the actual strategies that kick in.
I explained it in my last comment:
https://svn.boost.org/trac/boost/ticket/5954#comment:3
So, yes, my patch does not fix the problem, but sheds some light where
is the bug. Though, I'm having problems with finding out why the
different strategy is generated for simplify, not having enough time to
dig it now.
p.s. Please, take care to respond to the mailing list too. I added ggl
address to my response here.
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