feature abstract method

void feature({
  1. Object? id,
  2. WriteGeometries? geometry,
  3. Map<String, dynamic>? properties,
  4. Iterable<double>? bounds,
  5. WriteProperties? custom,
})

Writes a feature with id, geometry and properties.

The id, when non-null, should be either a string or an integer number.

At least one geometry using geometry should be written using methods defined by GeometryContent. When there are more than one geometry, it's recommended to use the name argument when writing those other.

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 along with those set by properties.

An example:

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

Implementation

void feature({
  Object? id,
  WriteGeometries? geometry,
  Map<String, dynamic>? properties,
  Iterable<double>? bounds,
  WriteProperties? custom,
});