Boost logo

Geometry :

Subject: [ggl] point on the border and within ?
From: Aleksandar Babic (aleksandarb)
Date: 2011-10-05 10:44:11


Hei,
I have the following problem - detecting point on the border of ring,
The code is like this:

typedef model::d2::point_xy<double> point_2d;
typedef model::ring<point_2d> ring_2d;

.....

point_2d p(3.0,2.0);

model::ring<point_2d, true, true> ccRing3;

ccRing3.push_back(point_2d(1.0,1.0));
ccRing3.push_back(point_2d(1.0,3.0));
ccRing3.push_back(point_2d(3.0,3.0));
ccRing3.push_back(point_2d(3.0,1.0));
ccRing3.push_back(point_2d(1.0,1.0));

cerr << "point within ccRing3(WINDING): " << (within(p, ccRing3) ? "YES":"NO") << endl;
cerr << "point within ccRing3(FRANKLIN): " << (within(p, ccRing3, strategy::within::franklin<point_2d>()) ? "YES":"NO") << endl;
cerr << "point within ccRing3(CROSSINGS): " << (within(p, ccRing3, strategy::within::crossings_multiply<point_2d>()) ? "YES":"NO") << endl;

....

I'm always getting NO.
Am I doing something wrong .. or this is a bug?

br
Aleksadnar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20111005/ea6d47ac/attachment.html


Geometry list run by mateusz at loskot.net