Boost logo

Geometry :

Subject: [ggl] Re: within() to return true if point is on border?
From: Denis Pesotsky (obey)
Date: 2011-04-10 19:33:11


boost::geometry::intersects(rect, polygon) is not good for me.

Look @ attached screenshots, first is initial (white thingies are
rectangles, big thing is polygon -- rectangular outer ring and 1
rectangular hole) and second is after removing each rectangles that
are not intersected by polygon (e.g. boost::geometry::intersects(rect,
polygon) for it returns false).

2011/4/11 Denis Pesotsky <obey_at_[hidden]>:
> Hi all.
>
> I need to detect if polygon (with holes) intersects box. Intersection
> is when they have shared square (e.g. intersection square > 0).
>
> Currently, I do following: http://paste.kde.org/10360/
>
> First funcion returns true, if box intersects ring.
> Second function (should) return true, if box is fully contained by
> ring (if some corner of box is on border, it still can return true).
> Third function (should) return true if box intersects (1st function)
> outer ring of polygon and is not contained (2nd function) by any inner
> ring of polygon.
>
> Second function result is bad for me, I need within() to return true
> if point is on border. Any way to do that? Or maybe I need to do
> something else?
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boost_geometry_intersects1.png
Type: image/png
Size: 5123 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/ggl/attachments/20110411/8e8d3d73/boost_geometry_intersects1.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boost_geometry_intersects2.png
Type: image/png
Size: 4839 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/ggl/attachments/20110411/8e8d3d73/boost_geometry_intersects2.png


Geometry list run by mateusz at loskot.net