Get routing zone ID

One possible way to get the zone IDs for avoidance is to obtain them from the routingZone blocks in the response message.

If a route passes multiple routing zones, you can find the involved routing zones in the routingZones section of the response message, provided you specified the parameter routingZones in the return option, for example return=travelSummary,summary,polyline,routingZones.

This request specifies a routingZones section in a route passing through Berlin as follows:

    "routingZones": [
        {
            "name": "BERLIN UMWELTZONE",
            "type": "environmental",
            "ref": "$0:all:$1:2"
        },
        {
            "name": "BRÜCKENSTRASSE DIESELFAHRVERBOT",
            "type": "environmental",
            "ref": "$0:all:$1:262"
        },
        {
            "name": "HERMANNSTRASSE DIESELFAHRVERBOT",
            "type": "environmental",
            "ref": "$0:all:$1:267"
        }
    ]

In the response message, the name and type fields of the zones can be obtained. The type of a routing zone is its category, which is described above. The ref field is a compressed form of the ID of the zone. It can be interpreted along with the refReplacements section, which is included in the same response message:

    "refReplacements": {
        "0": "hrn:here:data::olp-here:rib-2:2673:environmental-zones",
        "1": "here:cm:envzone"
    }

For example, to find out the ID of the first routing zone in the response, just check the last part of the ref field "ref": "$0:all:$1:2", which is $1:2". By replacing $1 with here:cm:envzone according to the refReplacements section, the zone ID here:cm:envzone:2 is obtained. Similarly, the IDs for the rest of the zones can be retrieved as here:cm:envzone:262 and here:cm:envzone:267. Avoiding the zones with those IDs will be described later in this page.

Additionally, the location of the zones along the route can be extracted with option span=routingZones. The information can be used to, for example, visualize the route polyline with routing zone highlighted.

results matching ""

    No results matching ""