FeatureCollection<E extends Feature<Geometry> > class
A feature collection contains an array of Feature items.
Feature collection are bounded objects with optional bounds defining a
minimum bounding box for a feature collection.
Some implementations may contain also custom data or "foreign members"
containing property objects.
According to the OGC Glossary a feature collection is "a set of related features managed as a group".
Supports representing data from GeoJSON (https://geojson.org/) features.
Constructors
-
FeatureCollection(List<
E> features, {Box? bounds, Map<String, dynamic> ? custom}) -
A feature collection with an array of
featureswith optionalboundsandcustomproperties.
Properties
- bounds → Box?
-
An optional bounding box explicitely set (or otherwise directly available)
for this object.
no setterinherited
- coordType → Coords
-
A value of
Coordsrepresenting the coordinate type of position data contained directly or within child objects.no setter -
custom
→ Map<
String, dynamic> ? -
Optional custom or "foreign member" properties as a map.
no setterinherited
-
features
→ List<
E> -
All feature items in this feature collection.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- isEmptyByGeometry → bool
-
Returns true if this feature collection do not contain any features.
no setter
- length → int
-
The number of features in this feature collection.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
boundsAligned2D(
{Aligned align = Aligned.center, PositionScheme scheme = Position.scheme}) → Position? -
Returns an aligned 2D position relative to a bounding box accessed by
getBounds.inherited -
calculateBounds(
{PositionScheme scheme = Position.scheme}) → Box? - Calculate a bounding box for this object.
-
copyWith(
{List< E> ? features, Map<String, dynamic> ? custom}) → FeatureCollection<E> -
Copy this feature collection with optional
featuresandcustomproperties. -
equals2D(
covariant FeatureObject other, {double toleranceHoriz = defaultEpsilon}) → bool -
True if this and
otherequals by testing 2D coordinate values of all position data (that must be in same order in both objects) contained directly or by child objects. -
equals3D(
covariant FeatureObject other, {double toleranceHoriz = defaultEpsilon, double toleranceVert = defaultEpsilon}) → bool -
True if this and
otherequals by testing 3D coordinate values of all position data (that must be in same order in both objects) contained directly or by child objects. -
equalsCoords(
covariant FeatureObject other) → bool -
True if this and
othercontain exactly same coordinate values (or both are empty) in the same order and with the same coordinate type. -
getBounds(
{PositionScheme scheme = Position.scheme}) → Box? -
Returns the current
boundsif it's populated and conforms toscheme, or otherwise returns one calculated bycalculateBounds.inherited -
map(
E toFeature(E feature)) → FeatureCollection< E> -
Returns a new feature collection with all features mapped using
toFeature. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
populated(
{int traverse = 0, bool onBounds = true, PositionScheme scheme = Position.scheme}) → FeatureCollection< Feature< Geometry> > - Returns a feature object of the same subtype as this with certain data members populated.
-
project(
Projection projection) → FeatureCollection< E> -
Returns an object of the same subtype as this with all position data
projected using
projectionand non-positional properties left intact. -
toBytes(
{required BinaryFormat< FeatureContent> format, Endian? endian, Map<String, dynamic> ? options}) → Uint8List -
The binary representation of this feature object, with
formatapplied.inherited -
toString(
) → String -
The string representation of this feature object as specified by
GeoJSON.inherited -
toText(
{TextWriterFormat< FeatureContent> format = GeoJSON.feature, int? decimals, CoordRefSys? crs, Map<String, dynamic> ? options}) → String -
The string representation of this feature object, with
formatapplied.inherited -
unpopulated(
{int traverse = 0, bool onBounds = true}) → FeatureCollection< Feature< Geometry> > - Returns a feature object of the same subtype as this with certain data members unpopulated (or cleared).
-
writeTo(
FeatureContent writer) → void -
Writes this feature object to
writer.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator [](
int index) → E -
The feature at the given
indexin this feature collection.
Static Methods
-
build<
T extends Geometry> (WriteFeatures features, {int? count, Box? bounds, Map< String, dynamic> ? custom}) → FeatureCollection<Feature< T> > -
Builds a feature collection from the content provided by
features. -
fromData<
T extends Geometry> (Map< String, dynamic> data, {TextReaderFormat<FeatureContent> format = GeoJSON.feature, CoordRefSys? crs, Map<String, dynamic> ? options}) → FeatureCollection<Feature< T> > -
Decodes a feature collection from
dataconforming toformat. -
parse<
T extends Geometry> (String text, {TextReaderFormat< FeatureContent> format = GeoJSON.feature, CoordRefSys? crs, Map<String, dynamic> ? options}) → FeatureCollection<Feature< T> > -
Parses a feature collection from
textconforming toformat.