Place secondary polygons identified as holes (inner contours) under primary polygons identified as solids (outer contours) if the vertices of the holes lie completely within the vertices of the solids. This operation is performed for each primary polygon until all holes have been assigned.
a valid PBSmapping PolySet.
The algorithm identifies outer contours (solids) and inner contours (holes)
using either the default PBSmapping method (solids = increasing
holes = decreasing
"POS") or the rotational direction of the polygons
(solids = clockwise, holes = counter-clockwise).
It then systematically starts matching holes with solids based on their vertices being completely within the boundaries of the solid. If a hole happens to match a current solid completley (all vertices on the boundary), then the hole is not matched to this solid because it is a hole in another solid that creates space for the current solid.
To facilitate computation, the algorithm assumes that once a hole is located in a solid, it will not occur in any other solid. This means that for each successive solid, the number of candidate holes will either decrease or stay the same.
This function makes use of the PBSmapping hidden function
which uses the C code
"findPolys". The latter only returns events found
in a polygon (or on the boundary) but
.is.in evaluates all events and
returns a list containing:
"e.in" – events within the polygon,
"e.out" – events outside the polygon,
"all.in" – logical value of whether all events are in the polygon,
"all.out" – logical value of whether all events are outside the polygon,
"all.bdry" – logical value of whether all events occur on the boundary of the polygon
Returns the input PolySet where holes have been arranged
beneath appropriate solids for each
PID (original or redefined).
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Institute of Ocean Sciences (IOS), Sidney BC
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.