bufferm
Buffer zones for latitude-longitude polygons
Syntax
[latb,lonb] = bufferm(lat,lon,bufwidth)
[latb,lonb] = bufferm(lat,lon,bufwidth,direction)
[latb,lonb] = bufferm(lat,lon,bufwidth,direction,npts)
Description
[latb,lonb] = bufferm(lat,lon,bufwidth)
computes
the buffer zone around a line or polygon. If the vectors lat
and lon
,
in units of degrees, define a line, then latb
and lonb
define
a polygon that contains all the points that fall within a certain
distance, bufwidth
, of the line. bufwidth
is
a scalar specified in degrees of arc along the surface. If the vectors lat
and lon
define
a polygon, then latb
and lonb
define
a region that contains all the points exterior to the polygon that
fall within bufwidth
of the polygon.
[latb,lonb] = bufferm(lat,lon,bufwidth,direction)
where direction
specifies whether the buffer zone is inside
('in'
) or outside ('out'
) of the polygon. A third
option, 'outPlusInterior'
, returns the union of an exterior buffer (as
would be computed using 'out'
) with the interior of the polygon. If you
do not supply a direction
value, bufferm
uses
'out'
as the default and returns a buffer zone outside the polygon.
If you supply 'in'
as the direction
value,
bufferm
returns a buffer zone inside the polygon. If you are finding
the buffer zone around a line, 'out'
is the only valid option.
[latb,lonb] = bufferm(lat,lon,bufwidth,direction,npts)
controls the number of points used to construct circles about the vertices of the polygon.
A larger number of points produces smoother buffers, but requires more time. If
npts
is omitted, 13 points per circle are used.
Examples
Tips
Close all polygons before processing them with bufferm
.
If a polygon is not closed, bufferm
assumes it
is a line.