populated method
MultiLineString
populated({
- int traverse = 0,
- bool onBounds = true,
- PositionScheme scheme = Position.scheme,
override
Returns a geometry of the same subtype as this with certain data members populated.
If nothing is populated then this
is returned.
If onBounds
is true (as by default):
- The
bounds
in a returned geometry object is ensured to be populated (expect when cannot be calculated, for example in the case of an empty geometry). - If
traverse
> 0, then also bounding boxes of child geometry objects of this geometry are populated for child levels indicated bytraverse
(0: no childs, 1: only direct childs, 2: direct childs and childs of them, ..).
Use scheme
to set the position scheme:
Position.scheme
for generic position data (geographic, projected or any other), this is also the defaultProjected.scheme
for projected position dataGeographic.scheme
for geographic position data
See also unpopulated.
Implementation
@override
MultiLineString populated({
int traverse = 0,
bool onBounds = true,
PositionScheme scheme = Position.scheme,
}) {
if (onBounds) {
// create a new geometry if bounds was unpopulated or of other scheme
final b = bounds;
final empty = chains.isEmpty;
if ((b == null && !empty) ||
(b != null && !b.conforming.conformsWith(scheme))) {
return MultiLineString(
chains,
bounds: empty
? null
: chains.map((c) => c.getBounds(scheme: scheme)).merge(),
);
}
}
return this;
}