Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Splitting (and simplifying) complex polygon with holes

Subject: CGAL users discussion list

List archive

[cgal-discuss] Splitting (and simplifying) complex polygon with holes


Chronological Thread 
  • From: "Ch'Gans" <>
  • To:
  • Subject: [cgal-discuss] Splitting (and simplifying) complex polygon with holes
  • Date: Fri, 31 Mar 2017 03:13:15 +1300
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:ycRDBxYX9Ga5/aUkHA8uRjf/LSx+4OfEezUN459isYplN5qZocu6bnLW6fgltlLVR4KTs6sC0LuK9fi4EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQtFiT6ybL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPCTQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjmk8qxlSgLniD0fOjA5/m/ZidF+grxHrx+6ohxz35TZbZuJOPZifK7Qe84RS2pbXsZWUixMGo2wYpUPD+YCPOhXtY/9p0AAoRCjAgSjGOPvyjBSiX/wxq03yOshEQfc0wA6GNIOqnvUoczzOawPUu611LHFwSvfY/5Swzvw64jFfgo/rf2SQb58a9fdxEszGw7Dk16es5bqPymP2eQIq2Wb7/RvVeaoi2M/rgF+uDmvxsM1honQhYIZ1knI9StkzIs3OdG0UkF7YdmjEJtfsyGVKZF6Td8lQ2FtoCo6y7sGtoCnfCUS1pgr2xrSZ+aEfoWI+B7vSvidLStiiH54er+zmw6+8U26xe39Usm03kxKri1AktTUqn8N1xPT5dKBSvtm5Uqh1jOP2BrS6uFAO0w7ia3bK5s5zr4qipUTqVjDHjPxmEjukKCWeV8r+uyx5+v6Y7XmvYOTN5JvigHlKakugcy+AeEgMgcURWSb+OK81Kfi/ULjWrlKgOc2weHlt8XRKs0f46K4GARIyZ0L6hClDj7g3s5Ls2MAKQcPUxLIoIHvIBuGdPv4Av65mHyjlj4twOrJaO6ySq7RJ2TOxe+yNY127FRRnVI+

Hi there,

I am using an R-Tree (Boost.Geometry) to do spatial queries, my
geomtric items range from small rectangle to long "thick" lines and
complex polygon with holes.

Some of my polygons have a bounding box that nearly covers the whole
set of items my rtree have to deal with, and I need to efficiently do
collision detection b/w the small items and the big polygons. Since
the rtree works with bounding box, I gain nothing when inserting such
"huge" items (their bounding box collides with everyone else's
bounding box).
See attached picture showing a layer of 254 polygons with holes for a
total of ca 70000 points: green are polygon outer boundaries, yellow
are inner boundaries, blue are outer boundary bounding box and magenta
inner boundary bounding box.

I would first like to split these big polygons into a set of smaller
polygons (or rectangles), so that i can take advantage of my rtree. I
don't care about how optimal the partitioning is, my definition of
optimum is: generate quickly sub-polygons that have a small-enough
bounding box.

I looked at CGAL polygon partitioning algos, and the optimal convex
partition looks sexy, but with complexity such as O(n^4) I think it is
no-go for me. The approximate convex partitioning has better
performance, but it seems that in my case it will produce sub-polygons
which will potentially have "big" bounding boxes.

Then there's the triangulation, but given the (very) detailed
"coast-line" of my polygon, it might not be efficient and will
certainly produce a massive amount of triangles. Maybe if i combine
this with multi-polyline simplification it might work... But this
sounds like requiring lot of CPU ...

A simple algo I had in mind is spliting a polygon according to a
coarse grid: lay out a polygon on a grid, then insert a grid cell in
the rtree, iff the cells overlaps the polygon. I thing it's a classic
approach in graphics toolkit (Qt has QRegion for this if i'm not
wrong). this could potentially be refined using a dichotomy
approach... Maybe i could use a CGAL arrangement and monitor face
splitting as i insert horizontal/vertical grid lines...

Anyhow, I thought i would send a word to this mailing list, and see is
someone has an opinion about these sort of problem, maybe i've missed
an awesome CGAL super-weapon, or maybe i'm trying to be too
clever/complicated.

Thanks,
Chris

Attachment: Screenshot_20170331_023242.png
Description: PNG image




Archive powered by MHonArc 2.6.18.

Top of Page