project method

  1. @override
Feature<T> 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
Feature<T> project(Projection projection) {
  final projectedGeom = geometry?.project(projection) as T?;

  return Feature<T>(
    id: id,
    geometry: projectedGeom,
    properties: properties,
    custom: custom,
  );
}