Feature

public struct Feature
extension Feature: Equatable

The Feature structure encapsulates a GeoJSON Feature - a geospatial object with associated properties. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a Geometry object and additional properties.

Lifecycle

  • Creates Feature.

    Declaration

    Swift

    public init(
        type: String,
        properties: [String: Any]?,
        geometry: Geometry?,
        id: String,
        bbox: [Double]
    )

    Parameters

    type

    The type of GeoJSON object, which should always be “Feature” in this context.

    properties

    A dictionary that holds any custom data associated with the geographical object.

    geometry

    The Geometry object represents the spatial data of the feature, such as location, shape, etc.

    id

    A unique identifier for the feature. It’s typically a string but can be any value that uniquely identifies the feature.

    bbox

    An optional bounding box that describes the spatial extent of the feature. It’s an array with minimum and maximum coordinates for each dimension.

Public

  • Specifies the type of the GeoJSON object - for a Feature, this will always be “Feature”.

    Declaration

    Swift

    public let type: String
  • Contains any additional data associated with the feature, structured as key-value pairs.

    Declaration

    Swift

    public let properties: [String : Any]?
  • Encapsulates the spatial data for the feature, which could be a point, line, polygon, etc.

    Declaration

    Swift

    public let geometry: Geometry?
  • id

    A unique identifier for the feature, allowing it to be differentiated from other features.

    Declaration

    Swift

    public let id: String
  • Includes information on the coordinate range. Bounding box is an array of length 2*n where n is the number of dimensions represented in the contained geometries. At a minimum, a bounding box has two coordinates that define a rectangle. A 3D bounding box can be produced if elevation or altitude is defined.

    Declaration

    Swift

    public let bbox: [Double]

Equatable

  • Equatable implementation.

    Declaration

    Swift

    public static func == (lhs: TomTomSDKCommon.Feature, rhs: TomTomSDKCommon.Feature) -> Bool