closePolygonParts
Close all rings in multipart polygon
Syntax
[xdata, ydata] = closePolygonParts(xdata,
ydata)
[lat, lon] = closePolygonParts(lat, lon, angleunits)
Description
[xdata, ydata] = closePolygonParts(xdata,
ydata)
ensures that each ring in a multipart (NaN
-separated)
polygon is “closed” by repeating the start point at
the end of each ring, unless the start and end points are already
identical. Coordinate vectors xdata
and ydata
must
match in size and have identical NaN
locations.
[lat, lon] = closePolygonParts(lat, lon, angleunits)
works with
latitude-longitude data and accounts for longitude wrapping with a period of
360
if angleunits
is
'degrees'
and 2*pi
if
angleunits
is 'radians'
. For a ring to be
considered closed, the latitudes of its first and last vertices must match exactly, but
their longitudes need only match modulo the appropriate period. Such rings are returned
unaltered.
Examples
Version History
Introduced in R2006a