Mapping Toolbox | ![]() ![]() |
Polygon Boolean Operations
Polygon Boolean operations are used to answer a variety of questions about vector data. Standard Boolean operations include intersection, union, subtraction, and an exclusive or operation. The polybool
command carries out these operations on pairs of vectors. These vectors can be thought of as x-y coordinates or as latitude-longitude pairs. As for the intersection
command, the interpolations are carried out on the coordinates as if they were Cartesian. Here is an example that shows all of the available operations.
The result is returned as NaN-clipped vectors by default. In cases where it is important to distinguish outer contours of polygons from interior holes, polybool
can also accept inputs and return outputs as cell arrays. In the cell array format, a cell array entry starts with the list of points making up the outer contour. Subsequent NaN-clipped faces within the cell entry are interpreted as interior holes.
![]() | Vector Calculations - Intersections | Cutting Polygons at the Dateline | ![]() |