AvoidanceOptions
public struct AvoidanceOptions : Hashable
The options to specify restrictions for route calculations.
-
Features which routes should avoid. Best effort only (not enforced).
Declaration
Swift
public var roadFeatures: [RoadFeatures] -
Countries that the route must avoid. Strictly enforced. Violations are reported as
SectionNoticeCode.violatedBlockedRoad. Note: This avoidance option is not supported inIsolineOptionsfor isoline calculation.Declaration
Swift
public var countries: [CountryCode] -
List of rectangular shapes which routes must not cross and additional options for this area.
Declaration
Swift
public var avoidBoundingBoxAreasOptions: [AvoidBoundingBoxAreaOptions] -
List of polygon shapes which routes must not cross and additional options for this area. Note: Currently, the maximum count of polygons is limited to 20.
Declaration
Swift
public var avoidPolygonAreasOptions: [AvoidPolygonAreaOptions] -
List of corridor shapes which routes must not cross and additional options for this area. Note: Currently, the maximum count of corridors is limited to 20.
Declaration
Swift
public var avoidCorridorAreasOptions: [AvoidCorridorAreaOptions] -
Zone categories which routes must not cross. Strictly enforced. Violations are reported as
SectionNoticeCode.violatedZoneRestriction.Declaration
Swift
public var zoneCategories: [ZoneCategory] -
Segments that routes will avoid going through. Violations are reported as
SectionNoticeCode.violatedBlockedRoad.Notes:
- This avoidance option is not supported in
IsolineOptionsfor isoline calculation. - The engine does not support an unlimited number of segments to avoid. The limit is defined by the HERE backend services and may change. For now, the maximum number of segments to avoid should be below 250. This value may change on the backend and it is therefore not guaranteed to be stable.
Declaration
Swift
public var segments: [SegmentReference] - This avoidance option is not supported in
-
Exception to
AvoidanceOptions.zone_categories, which can be specified by list of zone identifiers. e.g. the format of ID is likehere:cm:envzone:2. Information about the various routing zones originates from the respective catalogs of platform.here.com. For example, more information on zone IDs for Environmental Zones is available under “https://platform.here.com/data/hrn:here:data::olp-here:rib-2/environmental-zones/overview”.Declaration
Swift
public var exceptZoneIds: [String] -
List containing identifiers of zones that routes should avoid going through. e.g. the format of ID is like
here:cm:envzone:2. Information about the various routing zones originates from the respective catalogs of platform.here.com. For example, more information on zone IDs for Environmental Zones is available under “https://platform.here.com/data/hrn:here:data::olp-here:rib-2/environmental-zones/overview”.Declaration
Swift
public var zoneIds: [String] -
Specifies a list of avoided truck road types for vehicle. Refer to
TruckRoadTypefor the available options.Declaration
Swift
public var avoidedTruckRoadTypes: [TruckRoadType] -
init(roadFeatures:countries: avoidBoundingBoxAreasOptions: avoidPolygonAreasOptions: avoidCorridorAreasOptions: zoneCategories: segments: exceptZoneIds: zoneIds: avoidedTruckRoadTypes: ) Creates a new instance.
Parameters
- roadFeatures: Features which routes should avoid. Best effort only (not enforced).
- countries: Countries that the route must avoid. Strictly enforced.
Violations are reported as
SectionNoticeCode.violatedBlockedRoad. Note: This avoidance option is not supported inIsolineOptionsfor isoline calculation. - avoidBoundingBoxAreasOptions: List of rectangular shapes which routes must not cross and additional options for this area.
- avoidPolygonAreasOptions: List of polygon shapes which routes must not cross and additional options for this area. Note: Currently, the maximum count of polygons is limited to 20.
- avoidCorridorAreasOptions: List of corridor shapes which routes must not cross and additional options for this area. Note: Currently, the maximum count of corridors is limited to 20.
- zoneCategories: Zone categories which routes must not cross. Strictly enforced.
Violations are reported as
SectionNoticeCode.violatedZoneRestriction. - segments: Segments that routes will avoid going through.
Violations are reported as
SectionNoticeCode.violatedBlockedRoad.
Notes:
- This avoidance option is not supported in
IsolineOptionsfor isoline calculation. - The engine does not support an unlimited number of segments to avoid.
The limit is defined by the HERE backend services and may change. For now,
the maximum number of segments to avoid should be below 250. This value may change
on the backend and it is therefore not guaranteed to be stable.
- exceptZoneIds: Exception to
AvoidanceOptions.zone_categories, which can be specified by list of zone identifiers. e.g. the format of ID is likehere:cm:envzone:2. Information about the various routing zones originates from the respective catalogs of platform.here.com. For example, more information on zone IDs for Environmental Zones is available under “https://platform.here.com/data/hrn:here:data::olp-here:rib-2/environmental-zones/overview”. - zoneIds: List containing identifiers of zones that routes should avoid going through.
e.g. the format of ID is like
here:cm:envzone:2. Information about the various routing zones originates from the respective catalogs of platform.here.com. For example, more information on zone IDs for Environmental Zones is available under “https://platform.here.com/data/hrn:here:data::olp-here:rib-2/environmental-zones/overview”. - avoidedTruckRoadTypes: Specifies a list of avoided truck road types for vehicle.
Refer to
TruckRoadTypefor the available options.
- exceptZoneIds: Exception to
Declaration
Swift
public init(roadFeatures: [RoadFeatures] = [], countries: [CountryCode] = [], avoidBoundingBoxAreasOptions: [AvoidBoundingBoxAreaOptions] = [], avoidPolygonAreasOptions: [AvoidPolygonAreaOptions] = [], avoidCorridorAreasOptions: [AvoidCorridorAreaOptions] = [], zoneCategories: [ZoneCategory] = [], segments: [SegmentReference] = [], exceptZoneIds: [String] = [], zoneIds: [String] = [], avoidedTruckRoadTypes: [TruckRoadType] = [])