length2D method
Returns the length of this geometry calculated in a cartesian 2D plane.
For points the result is 0.0
, for line strings the length of a line, for
polygons the perimeter of an area. Multi geometries and geometry
collections returns the sum of lengths of contained geometries.
To calculate lengths along the surface of the earth, see spherical
extensions for Iterable<Geographic>
and PositionSeries
implemented by
the package:geobase/geodesy.dart
library.
See also length3D.
Implementation
@override
double length2D() {
var length = 0.0;
for (final polygon in ringArrays) {
for (final ring in polygon) {
length += ring.length2D();
}
}
return length;
}