project method

  1. @override
GeometryCollection<E> project(
  1. Projection projection
)
override

Returns an object of the same subtype as this with all position data projected using projection and non-positional properties left intact.

If bounds object is available on this, then it's not projected and the returned object has it set null.

Examples:

// just project, the returned object has not bounds populated
someBoundedObject.project(someProjection);

// project and populate, the returned object has bounds populated
someBoundedObject.project(someProjection).populated(onBounds: true);

Implementation

@override
GeometryCollection<E> project(Projection projection) {
  final projected = _geometries
      .map<E>((geometry) => geometry.project(projection) as E)
      .toList(growable: false);

  return GeometryCollection<E>._(projected, coordType);
}