# (9) - HERE Routing API - Isoline Routing ![](https://i.imgur.com/ynKaWa7.jpg) We have already talked about the "route planning" function that calculates one route, and also the "Matrix Routing" that calculates multiple routes at the same time. Now let's talk about "Isoline Routing". Isoline is called "contour line" in Chinese. What is the relationship between contour line and route planning? According to the description of Wikipedia, the definition of contour is "a closed curve formed by points of equal elevation on a topographic map. It is a special form of **contours**." Please note the keyword "contours". ![](https://i.imgur.com/epEaLmM.png) Therefore, we can establish two concepts: 1. The contour must be a closed curve 2. At any point on the contour line, the altitude must be equal. But what does this have to do with route planning? We can give an example. I am the owner of a cake shop today. How do I decide where I can deliver it today? Because the cake cannot be left in the refrigerator for too long, I can simply stipulate that "delivery** is limited to customers within 15 minutes** of the journey", but how do I set the "15 minutes" range? This requires Isoline Routing. ![](https://i.imgur.com/QKRtR4r.jpg) Suppose I am the operator of a chain cake shop today, which is more important to me. I can analyze the delivery distance of each of my branches within 15 minutes, so that I know where there may be a lot of The demand for cakes (for example, the demand for afternoon tea in an office building) is not within the scope of my service, so I can increase my service base or adopt other strategies to satisfy more customers. For personal use, after I am fully charged at the electric vehicle charging station today, how do I know where the electricity can let me go? I may not have a clear destination. I just want to ride my bike around, so I can use the mileage of these electricity to calculate a "range that I can reach." If my electric vehicle manufacturer provides such a service, can it effectively reduce consumers’ mileage anxiety? ![](https://i.imgur.com/ICL5VeV.jpg) The picture below shows the range of 50 kilometers that I can drive at the electric vehicle charging station in Wanhua District, Taipei City after it is fully charged. In fact, it is close to Zhubei City in Hsinchu County. ![](https://i.imgur.com/eManMAD.jpg) Therefore, we can know that the use of Isoline Routing is not used to calculate the actual route, but to calculate an "reachable range", so it will be a closed polygon. The Isoline Routing of HERE Routing API also has the following features: * Support route planning for cars, trucks, and pedestrians. * It can support real-time/historical road conditions and predict a more accurate reach. * It is possible to calculate the reachable range of "departure from starting point" and "arrival to specific end point". * You can choose to calculate in a limited time or a limited distance. * Can avoid high-speed roads, toll roads, ferries, specific public transportation and so on. * Support the power consumption model of electric vehicles, and calculate more suitable for the reach of electric vehicles. * Support detailed truck restriction definitions, such as length/width/height/weight/number of axles/cargo, etc. The following is an example of Isoline Routing's return result. In the "isoline" attribute, you can see a "shape" with a string of latitude and longitude. This string of latitude and longitude is a series of points that constitute the closed polygon. And the "start" attribute below has the "originalPosition" attribute, and the latitude and longitude inside represent the starting point. ```json= { "response": { "metaInfo": { "timestamp": "2020-09-17T06:28:52Z", "mapVersion": "8.30.112.153", "moduleVersion": "7.2.202036-7801", "interfaceVersion": "2.6.76", "availableMapVersion": [ "8.30.112.153" ] }, "center": { "latitude": 52.5159999, "longitude": 13.3777999 }, "isoline": [ { "range": 100, "component": [ { "id": 0, "shape": [ "52.51688,13.3778286", "52.5172234,13.3780861", "52.5172234,13.3784294", "52.5158501,13.3798027", "52.5155067,13.3798027", "52.5153351,13.3792877", "52.5153351,13.3786011", "52.5155067,13.3780861", "52.5161934,13.3773994", "52.5165367,13.3773136", "52.51688,13.3778286" ] } ] } ], "start": { "linkId": "+733073542", "mappedPosition": { "latitude": 52.5160415, "longitude": 13.3782512 }, "originalPosition": { "latitude": 52.5159999, "longitude": 13.3777999 } } } } ``` ## Use HERE Routing API Reference Client to play with Isoline Routing In the article [Quickly Build Map Service (7)\- Know HERE Routing API-Route Planning](https://ithelp.ithome.com.tw/articles/10237145) We have already introduced [HERE Routing API Reference Client]( http://refclient.ext.here.com/) This useful tool, we can also use this tool to experience Matrix Routing, it will be more efficient. Open [HERE Routing API Reference Client](http://refclient.ext.here.com/), then first press "New Tab +" in the upper left corner, select "Caculate Isoline", you will see more A "Isoline 1" tab page is created, this tab page is Matrix Routing; and the "OLS 1" next to it is Routing API V8. ![](https://i.imgur.com/tymkpuC.gif) Then we can move the map to Taiwan. ![](https://i.imgur.com/tZ1RTZP.gif) Right-click on the map, and several familiar options will also appear: ![](https://i.imgur.com/SZpFbGw.png) Then please right-click anywhere on the map and select "Add Start" to define a starting point. Then select "Distance" in the "Range" on the left, enter "1000" in the "VALUE, M", and press "Send" in the lower right. Then a closed polygon will appear on the screen. In my case, I took the position of "Taipei 101" (latitude and longitude coordinates 25.033909, 121.564473) as the starting point, and used the preset mode to calculate the fastest route of the car, "Range The defined range is 1000 meters, and the range that appears on the screen is "the range that can be reached by driving 1000 meters from Taipei 101". ![](https://i.imgur.com/bd0GSRG.png) The most interesting thing about HERE Isoline Routing is that we can calculate more than one reachable range. Please change the "1000" in "Range" to "1000, 2000, 3000", which means that we have to calculate three ranges at once. 1000 meters, 2000 meters, and 3000 meters, then click "Send" in the lower right corner to see what happened. ![](https://i.imgur.com/XSzSgaD.png) Among the calculated results, it is particularly interesting that "Isoline 1" represents 2000 meters and "Isoline 2" represents 3000 meters. It can be seen that the calculated reach will vary with the distribution of roads. "Isoline 2" even changes due to the shape of the bridge, which means that HERE Isoline Routing can faithfully reflect the realistic reach, instead of the traditional method of calculating the range with the center of the circle and the radius. Using Isoline Routing, you can more accurately calculate the range that can be reached within a certain time or distance, which is very valuable in social security and business analysis. ![](https://i.imgur.com/xNrW4ku.png) Next, let’s try to calculate the reachable range based on time. Please select "TIME" in the "Range" on the left, and enter "900" in the "VALUE, S" below, which represents 900 seconds, which is 15 minute. For the "TRAFFIC ROUTING" below, select "Enabled", which will take the road conditions into consideration, and the calculated reach will be more realistic. ![](https://i.imgur.com/qEw3xLG.png) After pressing "Send" in the lower right corner, it will calculate the range that will be reached by driving 15 minutes from the starting point. In this case, you can reach Xindian, Neihu, Nangang and Dajia Riverside Park as far as 15 minutes from Taipei 101. It can be seen that as long as there are high-speed roads, the reach will extend outward. This is because the high-speed roads travel faster than normal roads, so they can travel farther distances at the same time. Therefore, it is also 15 minutes. Staying in the city will only reach Daan Forest Park, but you can go to the new store on the high express road. ![](https://i.imgur.com/Ni3NW02.png) Let me repeat the motto in the previous lesson [Quickly Build Map Services (8)-Understanding Matrix Routing](https://ithelp.ithome.com.tw/articles/10237882) "** Looks close It’s not necessarily close, and what looks far is not necessarily far**”, and HERE Isoline Routing is also a convenient tool to help you get the right concept of space/time. Next, let's show how the reach of electric vehicles is different from that of ordinary vehicles. Please click "New Tab +" in the upper left corner to add a "Calc Isoline" tab. Here it will be "Isoline 2". Then, enter the following latitude and longitude at the starting point of "Isoline 2": 23.912213,120.686272, which is a location in Nantou City, then select "Consumption" in "Range", and enter "10000" in "Value" below ,20000,30000" (in Wh) means that the remaining power is 10000Wh, 20000Wh, 30000Wh. As for "Traffic Routing", you can choose freely, because this is not the point. ![](https://i.imgur.com/aVJl32M.png) Then press the "Features" under "Mode", there will be seven kinds of road avoidance options, please select "Strict Exclude" in both "TOLLROADS" and "MOTORWAYS", so as not to affect the calculation results of high express roads. ![](https://i.imgur.com/UutN9r3.png) Then the "Consumption" below, please select "Default". Then press "Send" in the lower right corner to calculate the farthest range that three electric vehicles can reach from Nantou City with the remaining power of 10000Wh, 20000Wh, and 30000Wh. It should be noted here that you will find that the range to the northwest, southwest, and north is much farther than to the northeast and southeast. why? You might have guessed that because of the characteristics of electric vehicles, going downhill is very energy-efficient and can even be recharged, but going uphill is very power-consuming, so compared to the northeast and southeast, there is much less than in other directions. ![](https://i.imgur.com/HUyGrK5.png) If you change "Range" to "DISTANCE", the result is that there is not so much difference between the east and west directions. ![](https://i.imgur.com/k1YSM5p.png) Does this comparison make you better understand the uniqueness of HERE in general car route calculation and electric vehicle route calculation? Then let's play with a parameter "Max Points". The interesting part of this parameter is that you can adjust the fineness of the polygons according to your needs. Please change the value inside to "50", which means that each calculated polygon cannot exceed 50 points. The resulting polygon is very rough, but it also saves the time and flow of return. So you can adjust this parameter according to your needs. ![](https://i.imgur.com/yza6QGz.png) Similarly, the URL in the "API CALL" below can also be copied and used with minor modifications, for example: ```javascript= https://isoline.route.api.here.com/routing/7.2/calculateisoline.json ?mode=fastest;car;motorway:-3,tollroad:-3 &maxpoints=50 &rangetype=distance &range=10000,20000,30000 &jsonattributes=41 &quality=1 &start=geo!stopOver!23.912213,120.686272 &app_code=pxIXqdtgOSwQDXSDfjLQpw &app_id=cgZPrYfgRePXzXC3PbBp ``` After modification, it becomes: ```javascript= https://isoline.route.ls.hereapi.com/routing/7.2/calculateisoline.json ?mode=fastest;car;motorway:-3,tollroad:-3 // The fastest car route, completely avoiding high express highways and toll roads &maxpoints=50 // Polygon has up to 50 points &rangetype=distance // Use distance to calculate range &range=10000,20000,30000 // Define the three ranges as 10000, 20000, 30000 respectively &jsonattributes=41 // 41 = 1 (the first character of the attribute is lowercase) + 8 (add the "_type" attribute to the object) + 32 (the shape of the return route is double instead of a string) &quality=1 // best quality &start=geo!stopOver!23.912213,120.686272 // starting point &apikey={APIKEY} // Your APIKEY ``` The above is the introduction of HERE Isoline Routing. We have introduced the three main functions of HERE Routing API: 1. Route planning function: calculate the complete route from point to point. 2. Matrix Routing: Establish the correct spatial relationship between multiple points. 3. Isoline Routing: Establish an accessible range in a certain time or space. Now we are able to answer almost all basic questions about spatial relations: 1. How do I **get** where I want to go? **How much time**? **How far** to go? 2. How do I choose the **fastest** or **nearest** destination? 3. How do I know where I can go **furthest**? 4. There are so many places I want to go, how do I decide the order of **? If you are a Location Based Service (LBS) provider, these four topics are definitely difficult problems you must face, and HERE Routing API and Waypoints Sequence are the best tools to help you meet customer needs! ※ To learn more about the parameters and usage of Isoline Routing, please go to [HERE Developer Site](https://developer.here.com/documentation/routing/dev_guide/topics/resource-calculate-isoline.html).