Mapping Toolbox    
polybool

Perform polygon boolean operations.

Syntax

Description

[lat,lon] = polybool(flag,x1,y1,x2,y2) performs the polygon boolean operation identified by flag. Valid flags strings are one of the following alternatives: ('intersection','and','&'), ('union','or','|','+','plus'), ('exclusiveor','xor') and ('subtraction','minus','-'). The polygon inputs are NaN-delimited vectors, or cell arrays containing individual polygons in each element with the outer face separated from the subsequent inner faces by NaNs. The result is output as NaN-delimited vectors.

[lat,lon] = polybool(flag,x1,y1,x2,y2,outputformat) controls the format of the resulting polygons. If outputformat is 'vector', the result is returned as vectors with NaNs separating the faces. No distinction is made between outer and inner faces of polygons. If outputformat is 'cutvector', inner faces are connected to the enclosing polygon face by inserting a cut. If outputformat is 'cell', the result is returned as cell arrays containing individual polygons in each element, with the outer face separated from the subsequent inner faces by NaNs. If omitted, 'vector' is assumed.

Limitations

Polygons are assumed to be in a cartesian coordinate system. As such, geographic data that encompasses a pole cannot be used directly. Use flatearthpoly to convert polygons to cartesian coordinates.

Example

See Also
bufferm
Compute buffer zones for vector data
polyjoin
Convert polygon segments from cell array to vector format
polysplit
Extract segments of NaN-delimited polygon vectors to cell arrays


  polcmap polyjoin