featureCollection abstract method

void featureCollection(
  1. WriteFeatures features, {
  2. int? count,
  3. Iterable<double>? bounds,
  4. WriteProperties? custom,
})

Writes a feature collection with an array of features.

An optional expected count, when given, specifies the number of features in a collection. Note that when given the count MUST be exact.

An optional bounds can used set a minimum bounding box for a geometry written. A writer implementation may use it or ignore it. Supported coordinate value combinations by coordinate type:

Type Expected values
xy minX, minY, maxX, maxY
xyz minX, minY, minZ, maxX, maxY, maxZ
xym minX, minY, minM, maxX, maxY, maxM
xyzm minX, minY, minZ, minM, maxX, maxY, maxZ, maxM

Use custom to write any custom or "foreign member" properties.

An example:

  content.featureCollection(
      count: 2,
      (features) => features
          ..feature(
              id: '1',
              geometry: (geom) => geom.point([10.123, 20.25]),
              properties: {
                 'foo': 100,
                 'bar': 'this is property value',
                 'baz': true,
              },
          )
          ..feature(
              id: '2',
              // ...
          ),
  );

Implementation

void featureCollection(
  WriteFeatures features, {
  int? count,
  Iterable<double>? bounds,
  WriteProperties? custom,
});