ReverseGeocoderOptions
public struct ReverseGeocoderOptions
Defines the input to the reverse geo coder.
-
init(position:
heading: radius: locale: roadUses: entityTypes: geopoliticalView: preferClosestAccurateAddress: fetchGeometry: ) 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> = [], entityTypes: Set<EntityType> = [], geopoliticalView: GeopoliticalView? = nil, 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 in meters 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.
entityTypes
Specifies the level of filtering performed on geographies.
geopoliticalView
Defines what kind of geopolitical view should be used.
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.
-
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.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…360Declaration
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 metersDeclaration
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 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]
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var entityTypes: Set<EntityType>
-
Defines what kind of geopolitical view should be used.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var geopoliticalView: GeopoliticalView?
-
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 fetchGeometry: Bool