ReverseGeocoderOptions

public struct ReverseGeocoderOptions

Defines the input to the reverse geo coder.

Important

This is a Public Preview API. It may be changed or removed at any time.

Lifecycle

  • Declaration

    Swift

    public init(
        position: CLLocationCoordinate2D,
        heading: Measurement<UnitAngle>? = nil,
        radius: Measurement<UnitLength> = .init(value: 500, unit: .meters),
        locale: Locale? = nil,
        supportedRoadUses: [RoadUse] = [],
        supportedEntityTypes: [EntityType] = [],
        geopoliticalView: String? = nil,
        supportedMapCodeTypes: [MapCodeType] = [],
        preferClosestAccurateAddress: Bool = false,
        shouldFetchGeometry: Bool = false
    )

    Parameters

    position

    A coordinate to reverse geocode.

    heading

    The directional heading of the vehicle in degrees when it is traveling along a segment of roadway.

    radius

    The maximum distance in meters from the specified position that the reverse geocoder will deliver results for. Default value: 500 meters

    locale

    The preferred locale. Defaults to system locale.

    supportedRoadUses

    Restricts reverse geocoding to certain types of road uses.

    supportedEntityTypes

    Specifies the level of filtering performed on geographies.

    geopoliticalView

    An ISO 3166-1 alpha3 country code, that gives the context used to resolve the handling of disputed territories.

    supportedMapCodeTypes

    Acts as a filter, so only the results with provided map code types are returned.

    preferClosestAccurateAddress

    Gives the preference to the closest accurate address over the address with the closest coordinates to route to.

    shouldFetchGeometry

    Enables the inclusion of geometry shapes for the provided reverse geocoding results.

Public

  • Describes the error that might occur when building options.

    Declaration

    Swift

    public enum ValidationError : Error
  • A coordinate that will be translated into a human-understandable street address, street element, or geography.

    Declaration

    Swift

    public let position: CLLocationCoordinate2D
  • The directional heading of the vehicle in degrees when it is traveling along a segment of roadway. Zero is North, 90 is East and so on.

    Note

    the value should be in range of 0…360

    Declaration

    Swift

    public var heading: Measurement<UnitAngle>?
  • The maximum distance in meters from the specified position that the reverse geocoder will deliver results for. Default value: 500 meters.

    Note

    the value should be in range of 1…5000

    Declaration

    Swift

    public var radius: Measurement<UnitLength>?
  • The preferred locale. Defaults to system locale.

    Declaration

    Swift

    public var locale: Locale?
  • Restricts reverse geocoding to certain types of road uses.

    Declaration

    Swift

    public var supportedRoadUses: [RoadUse]
  • Specifies the level of filtering performed on geographies. Providing this parameter narrows the search to specified geography entity types. The resulting response will contain the geography ID as well as the matched entity type. This ID is a token that can be used to get the geometry of that geography. The following parameters are ignored when entityType is set: [heading], [preferredBuildingNumber], [fetchSupportedRoads], [supportedRoads]

    Declaration

    Swift

    public var supportedEntityTypes: [EntityType]
  • An ISO 3166-1 alpha3 country code, that gives the context used to resolve the handling of disputed territories. If there are no geopolitical views for the provided country code then the default view is used.

    Declaration

    Swift

    public var geopoliticalView: String?
  • Acts as a filter, so only the results with provided map code types are returned. In addition, enables inclusion of the map codes in the result.

    Declaration

    Swift

    public var supportedMapCodeTypes: [MapCodeType]
  • Gives the preference to the closest accurate address over the address with the closest coordinates to route to.

    Declaration

    Swift

    public var preferClosestAccurateAddress: Bool
  • Enables the inclusion of geometry shapes for the provided reverse geocoding results. [supportedEntityTypes] must be set and the smallest available entity geometry is used.

    Declaration

    Swift

    public var shouldFetchGeometry: Bool