ReverseGeocoderOptions

public struct ReverseGeocoderOptions

Defines the input to the reverse geocoder.

Lifecycle

  • Important

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

    Declaration

    Swift

    public init(
        position: CLLocationCoordinate2D,
        heading: Measurement<UnitAngle>? = nil,
        radius: Measurement<UnitLength> = .tt.meters(500),
        locale: Locale = Locale.current,
        roadUses: Set<RoadUse> = [],
        areaTypes: Set<AreaType> = [],
        preferClosestAccurateAddress: Bool = false,
        fetchGeometry: 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 from the specified position that the reverse geocoder will deliver results for. Default value: 500 meters

    locale

    The preferred locale. Defaults to the user’s current locale.

    roadUses

    Restricts reverse geocoding to certain types of road uses.

    areaTypes

    Specifies the level of filtering performed on geographies.

    preferClosestAccurateAddress

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

    fetchGeometry

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

Public

  • Describes the error that might occur when building options.

    Important

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

    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 from the specified position for which the reverse geocoder delivers results. Default value: 500 meters.

    Note

    the value should be in range of 1…5000 meters

    Declaration

    Swift

    public var radius: Measurement<UnitLength>?
  • The preferred locale. Defaults to the user’s current locale.

    Important

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

    Declaration

    Swift

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

    Declaration

    Swift

    public var roadUses: Set<RoadUse>
  • Specifies the level of filtering performed on geographies. Providing this parameter narrows the search to specified geography area types. The resulting response will contain the geography ID as well as the matched area type. This ID is a token that can be used to get the geometry of that geography. The following parameters are ignored when areaTypes is set: heading, roadUses.

    Declaration

    Swift

    public var areaTypes: Set<AreaType>
  • 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. [areaTypes] must be set and the smallest available geometry is used.

    Declaration

    Swift

    public var fetchGeometry: Bool