buildList<T extends FeatureObject, E extends Geometry> static method

List<T> buildList<T extends FeatureObject, E extends Geometry>(
  1. WriteFeatures features, {
  2. int? count,
})

Builds a list of geospatial feature objects from the content provided by features.

Only feature objects of T are built, any other objects are ignored. T should be FeatureObject (building both features and feature collections), Feature or FeatureCollection.

Features or feature items on a collection contain a geometry of E.

An optional expected count, when given, specifies the number of feature objects in the content. Note that when given the count MUST be exact.

Implementation

static List<T> buildList<T extends FeatureObject, E extends Geometry>(
  WriteFeatures features, {
  int? count,
}) {
  final list = <T>[];
  final builder = FeatureBuilder<T, E>._(list.add);
  features.call(builder);
  return list;
}