ReverseGeocoderOptions

public struct ReverseGeocoderOptions

Defines the parameters of a Reverse Geocoding request.

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

    The coordinate that will be translated into a human-readable address.

    heading

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

    radius

    The maximum distance from the specified position that the reverse Geocoder will search in. Defaults to 500 meters.

    locale

    The language used to display the results. If not provided, the system default language is used.

    roadUses

    Filters results to roads with the intended usages.

    areaTypes

    Filters results to the provided geography area types. The following parameters are ignored when areaTypes is set: heading, roadUses.

    preferClosestAccurateAddress

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

    fetchGeometry

    Fetches the geometry shapes for the provided reverse geocoding results. (where available)

Public

  • Describes the errors that might occur when building options.

    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 due North, 90 is due 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