Skip to content

Objects

Avoid

Bases: object

Class that helps RoutingAPI to avoid routes that violate the properties it has.

Source code in herepy/objects.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class Avoid(object):
    """Class that helps RoutingAPI to avoid routes that violate the properties it has."""

    def __init__(self, features: List[AvoidFeature], areas: List[AvoidArea]):
        """Returns a Avoid instance.
        Args:
          features (List[AvoidFeature]):
            List of routing features to avoid during route calculation.
          areas (List[AvoidArea]):
            List of areas to avoid.
        """

        self.features = [avoid_feature.__str__() for avoid_feature in features]
        self.areas = [
            {
                "type": avoid_area.avoid_type.__str__(),
                "north": avoid_area.north,
                "south": avoid_area.south,
                "west": avoid_area.west,
                "east": avoid_area.east,
            }
            for avoid_area in areas
        ]

__init__(features, areas)

Returns a Avoid instance. Args: features (List[AvoidFeature]): List of routing features to avoid during route calculation. areas (List[AvoidArea]): List of areas to avoid.

Source code in herepy/objects.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def __init__(self, features: List[AvoidFeature], areas: List[AvoidArea]):
    """Returns a Avoid instance.
    Args:
      features (List[AvoidFeature]):
        List of routing features to avoid during route calculation.
      areas (List[AvoidArea]):
        List of areas to avoid.
    """

    self.features = [avoid_feature.__str__() for avoid_feature in features]
    self.areas = [
        {
            "type": avoid_area.avoid_type.__str__(),
            "north": avoid_area.north,
            "south": avoid_area.south,
            "west": avoid_area.west,
            "east": avoid_area.east,
        }
        for avoid_area in areas
    ]

AvoidArea

Bases: object

List of areas to avoid.

Source code in herepy/objects.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class AvoidArea(object):
    """List of areas to avoid."""

    def __init__(
        self,
        north: int,
        south: int,
        west: int,
        east: int,
        avoid_type: str = "boundingBox",
    ):
        """Returns a AvoidArea instance.
        Args:
          north (int):
            Latitude in WGS-84 degrees of the northern boundary of the box.
          south (int):
            Latitude in WGS-84 degrees of the southern boundary of the box.
          west (int):
            Longitude in WGS-84 degrees of the western boundary of the box.
          east (int):
            Longitude in WGS-84 degrees of the eastern boundary of the box.
          avoid_type (str):
            Type of avoid, default `boundingBox`.
        """

        self.north = north
        self.south = south
        self.west = west
        self.east = east
        self.avoid_type = avoid_type

__init__(north, south, west, east, avoid_type='boundingBox')

Returns a AvoidArea instance. Args: north (int): Latitude in WGS-84 degrees of the northern boundary of the box. south (int): Latitude in WGS-84 degrees of the southern boundary of the box. west (int): Longitude in WGS-84 degrees of the western boundary of the box. east (int): Longitude in WGS-84 degrees of the eastern boundary of the box. avoid_type (str): Type of avoid, default boundingBox.

Source code in herepy/objects.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(
    self,
    north: int,
    south: int,
    west: int,
    east: int,
    avoid_type: str = "boundingBox",
):
    """Returns a AvoidArea instance.
    Args:
      north (int):
        Latitude in WGS-84 degrees of the northern boundary of the box.
      south (int):
        Latitude in WGS-84 degrees of the southern boundary of the box.
      west (int):
        Longitude in WGS-84 degrees of the western boundary of the box.
      east (int):
        Longitude in WGS-84 degrees of the eastern boundary of the box.
      avoid_type (str):
        Type of avoid, default `boundingBox`.
    """

    self.north = north
    self.south = south
    self.west = west
    self.east = east
    self.avoid_type = avoid_type

Truck

Bases: object

Different truck options to use during route calculation when transportMode = truck

Source code in herepy/objects.py
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
class Truck(object):
    """Different truck options to use during route calculation when transportMode = truck"""

    def __init__(
        self,
        shipped_hazardous_goods: List[ShippedHazardousGood],
        gross_weight: int,
        weight_per_axle: int,
        height: int,
        width: int,
        length: int,
        tunnel_category: TunnelCategory,
        axle_count: int,
        truck_type: TruckType,
        trailer_count: int,
    ):
        """Returns a Truck instance.
        Args:
          shipped_hazardous_goods (List[ShippedHazardousGood]):
            List of hazardous materials in the vehicle.
          gross_weight (int):
            Total vehicle weight, including trailers and shipped goods, in kilograms.
          weight_per_axle (int):
            Vehicle weight per axle, in kilograms.
          height (int):
            Vehicle height, in centimeters.
          width (int):
            Vehicle width, in centimeters.
          length (int):
            Vehicle length, in centimeters.
          tunnel_category (TunnelCategory):
            Specifies the cargo tunnel restriction code. https://adrbook.com/en/2017/ADR/8.6.3
          axle_count (int):
            Total number of axles that the vehicle has.
          truck_type (TruckType):
            Specifies the type of truck.
          trailer_count (int):
            Number of trailers attached to the vehicle.
        """

        self.shipped_hazardous_goods = [
            hazardous_goods.__str__() for hazardous_goods in shipped_hazardous_goods
        ]
        self.gross_weight = gross_weight
        self.weight_per_axle = weight_per_axle
        self.height = height
        self.width = width
        self.length = length
        self.tunnel_category = tunnel_category.__str__()
        self.axle_count = axle_count
        self.truck_type = truck_type.__str__()
        self.trailer_count = trailer_count

__init__(shipped_hazardous_goods, gross_weight, weight_per_axle, height, width, length, tunnel_category, axle_count, truck_type, trailer_count)

Returns a Truck instance. Args: shipped_hazardous_goods (List[ShippedHazardousGood]): List of hazardous materials in the vehicle. gross_weight (int): Total vehicle weight, including trailers and shipped goods, in kilograms. weight_per_axle (int): Vehicle weight per axle, in kilograms. height (int): Vehicle height, in centimeters. width (int): Vehicle width, in centimeters. length (int): Vehicle length, in centimeters. tunnel_category (TunnelCategory): Specifies the cargo tunnel restriction code. https://adrbook.com/en/2017/ADR/8.6.3 axle_count (int): Total number of axles that the vehicle has. truck_type (TruckType): Specifies the type of truck. trailer_count (int): Number of trailers attached to the vehicle.

Source code in herepy/objects.py
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
def __init__(
    self,
    shipped_hazardous_goods: List[ShippedHazardousGood],
    gross_weight: int,
    weight_per_axle: int,
    height: int,
    width: int,
    length: int,
    tunnel_category: TunnelCategory,
    axle_count: int,
    truck_type: TruckType,
    trailer_count: int,
):
    """Returns a Truck instance.
    Args:
      shipped_hazardous_goods (List[ShippedHazardousGood]):
        List of hazardous materials in the vehicle.
      gross_weight (int):
        Total vehicle weight, including trailers and shipped goods, in kilograms.
      weight_per_axle (int):
        Vehicle weight per axle, in kilograms.
      height (int):
        Vehicle height, in centimeters.
      width (int):
        Vehicle width, in centimeters.
      length (int):
        Vehicle length, in centimeters.
      tunnel_category (TunnelCategory):
        Specifies the cargo tunnel restriction code. https://adrbook.com/en/2017/ADR/8.6.3
      axle_count (int):
        Total number of axles that the vehicle has.
      truck_type (TruckType):
        Specifies the type of truck.
      trailer_count (int):
        Number of trailers attached to the vehicle.
    """

    self.shipped_hazardous_goods = [
        hazardous_goods.__str__() for hazardous_goods in shipped_hazardous_goods
    ]
    self.gross_weight = gross_weight
    self.weight_per_axle = weight_per_axle
    self.height = height
    self.width = width
    self.length = length
    self.tunnel_category = tunnel_category.__str__()
    self.axle_count = axle_count
    self.truck_type = truck_type.__str__()
    self.trailer_count = trailer_count