Skip to main content

Feature<TGeometry, TProps>

Namespace: Meshmakers.Octo.Runtime.Contracts.Geospatial.Features

A GeoJSON Feature Object; generic version for strongly typed Feature<TGeometry, TProps>.Geometry and Feature<TGeometry, TProps>.Properties

public class Feature<TGeometry, TProps> : GeoJSONObject, IGeoJSONObject, IEqualityComparer<GeoJSONObject>, IEquatable<GeoJSONObject>, IEquatable<Feature<TGeometry, TProps>>

Type Parameters

TGeometry

TProps

Inheritance ObjectGeoJSONObjectFeature<TGeometry, TProps>
Implements IGeoJSONObject, IEqualityComparer<GeoJSONObject>, IEquatable<GeoJSONObject>, IEquatable<Feature<TGeometry, TProps>>

Remarks:

See https://tools.ietf.org/html/rfc7946#section-3.2

Properties

Type

public GeoJSONObjectType Type { get; }

Property Value

GeoJSONObjectType

Id

Gets the identifier.

public string Id { get; }

Property Value

String

Geometry

Gets the Geometry Object.

public TGeometry Geometry { get; }

Property Value

TGeometry

Properties

Gets the properties.

public TProps Properties { get; }

Property Value

TProps

BoundingBoxes

Gets or sets the (optional) Bounding Boxes.

public Double[] BoundingBoxes { get; set; }

Property Value

Double[]
The value of GeoJSONObject.BoundingBoxes must be a 2*n array where n is the number of dimensions represented in the contained geometries, with the lowest values for all axes followed by the highest values. The axes order of a bbox follows the axes order of geometries. In addition, the coordinate reference system for the bbox is assumed to match the coordinate reference system of the GeoJSON object of which it is a member.

CRS

Gets or sets the (optional)

Coordinate Reference System Object.

public ICRSObject CRS { get; set; }

Property Value

ICRSObject
The Coordinate Reference System Objects.

Constructors

Feature(TGeometry, TProps, String)

Initializes a new instance of the Feature class.

public Feature(TGeometry geometry, TProps properties, string id)

Parameters

geometry TGeometry

properties TProps

id String

Methods

Equals(Feature<TGeometry, TProps>)

Equality comparer.

public bool Equals(Feature<TGeometry, TProps> other)

Parameters

other Feature<TGeometry, TProps>

Returns

Boolean

Remarks:

In contrast to feature equals implementation, this implementation returns true only if Feature<TGeometry, TProps>.Id and Feature<TGeometry, TProps>.Properties are also equal. See #80 for discussion. The rationale here is that a user explicitly specifying the property type most probably cares about the properties equality.

Equals(Object)

public bool Equals(object obj)

Parameters

obj Object

Returns

Boolean

GetHashCode()

public int GetHashCode()

Returns

Int32