GeoFeatureCollection Class

A list of features, such as the countries of a map, as the readers return it and the writers take it.

public sealed class GeoFeatureCollection : Collection<GeoFeature>
Inheritance
Collection<GeoFeature> GeoFeatureCollection

Constructors

NameDescription
GeoFeatureCollection()Initializes a new instance of the GeoFeatureCollection class that is empty.
GeoFeatureCollection(IEnumerable<GeoFeature>)Initializes a new instance of the GeoFeatureCollection class that contains features.

GeoFeatureCollection overloads

GeoFeatureCollection()

GeoFeatureCollection.cs

Initializes a new instance of the GeoFeatureCollection class that is empty.

public GeoFeatureCollection()

GeoFeatureCollection(IEnumerable<GeoFeature>)

GeoFeatureCollection.cs

Initializes a new instance of the GeoFeatureCollection class that contains features.

public GeoFeatureCollection(IEnumerable<GeoFeature> features)
Parameters
features IEnumerable<GeoFeature>
The features.

Properties

NameDescription
CoordinateReferenceSystemGets or sets the coordinate reference system of the positions, such as the one of the .prj file of a shapefile, or null when it is not known: the positions are then expected to be longitudes and latitudes of WGS 84.
NameGets or sets the name of the collection, such as the name of a KML document or of a TopoJSON object, or null.

CoordinateReferenceSystem

GeoFeatureCollection.cs

Gets or sets the coordinate reference system of the positions, such as the one of the .prj file of a shapefile, or null when it is not known: the positions are then expected to be longitudes and latitudes of WGS 84.

public CoordinateReferenceSystem? CoordinateReferenceSystem { get; set; }

Property value

CoordinateReferenceSystem?

Remarks

The writers do not use it: convert the positions with GeoGeometry.Transform before writing them.

Gets or sets the name of the collection, such as the name of a KML document or of a TopoJSON object, or null.

public string? Name { get; set; }

Property value

string?

Methods

NameDescription
GetBounds()Gets the smallest box that contains the geometries of the features.
GetBounds(GeoEdgeType)Gets the smallest box that contains the geometries of the features, whose edges are drawn as an edge type says.

GetBounds overloads

Gets the smallest box that contains the geometries of the features.

public GeoBounds? GetBounds()
Returns

GeoBounds? The box, or null when no feature has a position.

GetBounds(GeoEdgeType)

GeoFeatureCollection.cs

Gets the smallest box that contains the geometries of the features, whose edges are drawn as an edge type says.

public GeoBounds? GetBounds(GeoEdgeType edgeType)
Parameters
edgeType GeoEdgeType
How the edges are drawn. See GeoGeometry.GetBounds.
Returns

GeoBounds? The box, or null when no feature has a position. With GeoEdgeType.Geodesic, it can cross the 180th meridian.