{"id":42283,"date":"2017-03-02T11:46:52","date_gmt":"2017-03-02T06:16:52","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=42283"},"modified":"2017-03-27T14:02:36","modified_gmt":"2017-03-27T08:32:36","slug":"how-to-plan-your-best-route-using-graphhopper-api","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/how-to-plan-your-best-route-using-graphhopper-api\/","title":{"rendered":"How to Plan Your Best Route Using GraphHopper API?"},"content":{"rendered":"<p><span style=\"font-size: 10.5pt;font-family: 'Helvetica','sans-serif';color: #444444\">Software engineers and organizations lookout for effective ways\u00a0to create new applications that save time and money. We can easily do this by using third-party software tools and SDKs.<\/span><\/p>\n<p><span style=\"font-size: 10.5pt;font-family: 'Helvetica','sans-serif';color: #444444\">This blog is to spread awareness about a useful routing API\u00a0<strong><span style=\"font-family: 'Helvetica','sans-serif'\">GraphHopper,<\/span><\/strong>\u00a0a third party SDK. I am working on a project which is based on routing and delivery mechanisms playing\u00a0two roles: Buyer and Carrier.<\/span><\/p>\n<p><span style=\"font-size: 10.5pt;font-family: 'Helvetica','sans-serif';color: #444444\">A buyer is a person who delivers\u00a0their load from location A to B while whereas carrier is the one who carries out and\u00a0processes the created delivery. In this blog, our motive is to find out the best ways for delivery in terms of time and distance which is readily available on<span class=\"apple-converted-space\">\u00a0<\/span><b>Google API.<\/b><\/span><\/p>\n<p><b><span style=\"font-size: 10.5pt;font-family: 'Helvetica','sans-serif';color: #444444\">An overview and importance of GraphHopper\u00a0<\/span><\/b><\/p>\n<p><b><span style=\"font-size: 10.5pt;font-family: 'Helvetica','sans-serif';color: #444444\">GraphHopper\u00a0<\/span><\/b><span style=\"font-size: 10.5pt;font-family: 'Helvetica','sans-serif';color: #444444\">works on the theory\u00a0&#8216;<b>Deliver more in less time&#8217;.<span class=\"apple-converted-space\">\u00a0<\/span><\/b>It\u00a0provides you with a Route Optimization API including real world constraints such as capacity restrictions, skill checks, time windows and more.<\/span><\/p>\n<p>There is a scenario in my <a title=\"Node.js development\" href=\"http:\/\/www.tothenew.com\/mean-node-js-development-consulting\">node.js application<\/a> that Buyer can upload a file with multiple deliveries (up to\u00a01000) for a week. They need to perform multiple deliveries between time t1 and time t2 in a given day and we need to find out the routes with multiple vehicles so that all deliveries can be completed in a certain period.<\/p>\n<p>For an instance, find route optimization for existing week, for each day one at a time. For example, on Monday, given all deliveries that need to happen before a certain time of the day, x routes will not help us to achieve it. We\u2019ll find x+1 routes and use that planning.<\/p>\n<p><b>How To Start?<\/b><\/p>\n<p>For using a GraphHopper\u00a0API you need an <a title=\"Things To Know Before You Start API Testing\" href=\"http:\/\/www.tothenew.com\/blog\/5-things-to-know-before-you-start-api-testing\/\">API key<\/a>. This is a paid service but for the development phase, you can create a key which is valid for 2 weeks.<\/p>\n<p><b>API Parts: <\/b>We can divide Graphhopper API into following\u00a0categories:<\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Routing API<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Route Optimization API<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Geocoding API<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Map Matching API<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Isochron API<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Matrix API<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">I will cover two APIs in this blog: <\/span><b>Routing API<\/b><span style=\"font-weight: 400\"> and <\/span><b>Route Optimization API.\u00a0<\/b>For more details, please\u00a0<a href=\"https:\/\/graphhopper.com\/\">visit their site<\/a>.<\/p>\n<p><b>Routing<\/b> <b>API:<\/b><\/p>\n<p><b>Endpoint:<\/b><span style=\"font-weight: 400\">\u00a0<\/span><br \/>\n<strong>cURL:\u00a0<\/strong>curl &#8220;https:\/\/graphhopper.com\/api\/1\/route?point=51.131%2C12.414&amp;point=48.224%2C3.867&amp;vehicle=car&amp;locale=de&amp;key=[YOUR_KEY]&#8221;<\/p>\n<p><b>Specification of Used Parameters:<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400\"><b>point: <\/b><span style=\"font-weight: 400\">You can specify multiple points to get the route. Points should be in order. At least two points are required to get the route between them.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>locale: \u00a0<\/b><span style=\"font-weight: 400\">Returned instruction in specified locale<\/span><\/li>\n<li style=\"font-weight: 400\"><b>vehicle: <\/b><span style=\"font-weight: 400\">Specify the vehicle for which the route should be calculated. Vehicles can be a car, bike, small truck, bus. <a href=\"https:\/\/graphhopper.com\/api\/1\/docs\/supported-vehicle-profiles\/\">See <\/a><\/span><a href=\"https:\/\/graphhopper.com\/api\/1\/docs\/supported-vehicle-profiles\/\"><span style=\"font-weight: 400\">here<\/span><\/a><span style=\"font-weight: 400\"><a href=\"https:\/\/graphhopper.com\/api\/1\/docs\/supported-vehicle-profiles\/\"> for details<\/a>.<\/span><\/li>\n<\/ul>\n<p><b>Output Json:<\/b><\/p>\n<p><span style=\"font-weight: 400\">Paths: An array of possible path<\/span><\/p>\n<p><span style=\"font-weight: 400\">Path[0].distance: Total distance of route(in meter)<\/span><\/p>\n<p><span style=\"font-weight: 400\">Path[0].time: total time taken by route(in milliseconds)<\/span><\/p>\n<p><span style=\"font-weight: 400\">Path[0].instructions: Information about the instructions of route.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Example Output:<\/span><\/p>\n<pre>{\r\n \"paths\": [\r\n {\r\n \"instructions\": [\r\n {\r\n \"distance\": 1051.612,\r\n \"sign\": 0,\r\n \"interval\": [\r\n 0,\r\n 24\r\n ],\r\n \"text\": \"Continue\",\r\n \"time\": 179565\r\n },\r\n {\r\n \"distance\": 132.064,\r\n \"sign\": -2,\r\n \"interval\": [\r\n 24,\r\n 29\r\n ],\r\n \"text\": \"Turn left onto K 7931\",\r\n \"time\": 7923\r\n },\r\n {\r\n \"distance\": 841.423,\r\n \"sign\": -2,\r\n \"interval\": [\r\n 29,\r\n 36\r\n ],\r\n \"text\": \"Turn left onto B 176\",\r\n \"time\": 45895\r\n },\r\n {\r\n \"distance\": 758.765,\r\n \"sign\": 0,\r\n \"interval\": [\r\n 36,\r\n 48\r\n ],\r\n \"text\": \"Continue onto Bornaer Stra\u00dfe, B 176\",\r\n \"time\": 41385\r\n },\r\n {\r\n \"distance\": 783.714,\r\n \"sign\": 0,\r\n \"interval\": [\r\n 48,\r\n 63\r\n ],\r\n \"text\": \"Continue onto B 176\",\r\n \"time\": 42747\r\n },\r\n {\r\n \"distance\": 0,\r\n \"sign\": 4,\r\n \"interval\": [\r\n 5521,\r\n 5521\r\n ],\r\n \"text\": \"Finish!\",\r\n \"time\": 0\r\n }\r\n ],\r\n \"descend\": 9829.136100769043,\r\n \"ascend\": 9843.335098266602,\r\n \"distance\": 899950.595,\r\n \"weight\": 27239.575076,\r\n \"time\": 27239361\r\n }\r\n ]\r\n}<\/pre>\n<p><b>Routing<\/b> <b>Optimization<\/b> <b>API:\u00a0<\/b>Route Optimization determines\u00a0the most cost-efficient route thereby reducing the cost and enhancing the overall experience. It automatically assigns efficient service orders to the best driver and plans the best stop sequences.<\/p>\n<p><span style=\"line-height: 1.71429;font-size: 1rem\">We can easily solve <strong>Travelling salesman<\/strong> or <strong>Vehicle routing<\/strong> problems by using Route Optimization API.<\/span><\/p>\n<p><b>Endpoint:<\/b><span style=\"font-weight: 400\">\u00a0<\/span><br \/>\n<span style=\"font-weight: 400\">The Route Optimization API works in two steps<\/span><\/p>\n<ul>\n<li><b>Post your problem json:<\/b><\/li>\n<\/ul>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Method<\/strong>: Post<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Header<\/strong>: \u201cContent-Type: application\/json\u201d<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Problem json in body<\/strong>: <\/span><span style=\"font-weight: 400\">your-vrp-problem.json. <\/span><span style=\"font-weight: 400\">You can use <a href=\"https:\/\/github.com\/graphhopper\/directions-api-js-client\/tree\/master\/route-optimization-examples\">one of <\/a><\/span><a href=\"https:\/\/github.com\/graphhopper\/directions-api-js-client\/tree\/master\/route-optimization-examples\"><span style=\"font-weight: 400\">these examples<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>API URL<\/strong>: \u201c<\/span><span style=\"font-weight: 400\">https:\/\/graphhopper.com\/api\/1\/vrp\/optimize?key=[YOUR_KEY]\u201d<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>cURL:\u00a0<\/strong>curl -X POST -H &#8220;Content-Type: application\/json&#8221; &#8220;https:\/\/graphhopper.com\/api\/1\/vrp\/optimize?key=[YOUR_KEY]&#8221; &#8211;data @your-vrp-problem.json<\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">We will get a <\/span><b>job id<\/b><span style=\"font-weight: 400\"> in this step which will be used in next step.<\/span><\/p>\n<ul>\n<li><b>Poll every 500ms until a solution is\u00a0<b>available:\u00a0<\/b><\/b><\/li>\n<\/ul>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>Method<\/strong>: Get<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><strong>API URL<\/strong>: <\/span><span style=\"font-weight: 400\">https:\/\/graphhopper.com\/api\/1\/vrp\/solution\/[RETURNED_JOB_ID]?key=[YOUR_KEY<\/span><span style=\"font-weight: 400\">]<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>cURL:\u00a0<\/strong>curl -X GET &#8220;https:\/\/graphhopper.com\/api\/1\/vrp\/solution\/[RETURNED_JOB_ID]?key=[YOUR_KEY]&#8221;<\/li>\n<\/ol>\n<h2><b>JSON Input<\/b><\/h2>\n<p><span style=\"font-weight: 400\">The general input structure is as follows:<\/span><\/p>\n<pre>{\r\n  \"configuration\": {..},\r\n  \"objectives\": [..],\r\n  \"cost_matrices\": [..],\r\n  \"vehicles\": [..],\r\n  \"vehicle_types\": [..],\r\n  \"services\": [..],\r\n  \"shipments\": [..],\r\n  \"relations\": [..]\r\n}\r\n\r\n<\/pre>\n<p><strong><span style=\"font-weight: 400\">Most used input parameters are <\/span><b>objectives<\/b><span style=\"font-weight: 400\">, <\/span><b>vehicles<\/b><span style=\"font-weight: 400\">, <\/span><b>vehicle_types<\/b><span style=\"font-weight: 400\">,\u00a0<\/span><b>services<\/b><span style=\"font-weight: 400\"> and <\/span><b>shipments.<\/b><\/strong><\/p>\n<p><b>Objectives:<\/b><br \/>\nIt requires two things namely, the type and the value to be optimized.<\/p>\n<ul>\n<li><strong>Type<\/strong>: min, min-max<\/li>\n<li><strong>Value<\/strong>: vehicles, transport_time, completion_time<\/li>\n<\/ul>\n<p><strong>Vehicles: <\/strong>It can only be used with min and minimizes vehicles.<br \/>\n<strong>Transport_time: <\/strong>It considers the time that\u00a0drivers spend on the road.<\/p>\n<pre>\"objectives\" : [\r\n   {\r\n      \"type\": \"min\",\r\n      \"value\": \"transport_time\"\r\n   }\r\n]   \r\n<\/pre>\n<p><strong>Completion_time:\u00a0<\/strong>It is the time from starting to end of the route\u00a0i.e. the route&#8217;s transport time, the\u00a0summation of total waiting time and total activity duration.<\/p>\n<pre>\"objectives\" : [\r\n   {\r\n      \"type\": \"min\",\r\n      \"value\": \"completion_time\"\r\n   }\r\n] \r\n<\/pre>\n<p>If you want to minimize vehicles first followed by completion_time, you can also combine different objectives as shown below:<\/p>\n<pre>\"objectives\" : [\r\n   {\r\n      \"type\": \"min\",\r\n      \"value\": \"vehicles\"\r\n   },\r\n   {\r\n      \"type\": \"min\",\r\n      \"value\": \"completion_time\"\r\n   }\r\n]  \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Vehicles:<\/strong><br \/>\n<span style=\"font-weight: 400\">If you want your vehicle to come back, specify it like this:<\/span><\/p>\n<pre>{\r\n    \"vehicle_id\": \"your-vehicle-id\",\r\n    \"start_address\": {\r\n        \"location_id\": \"your-location-id\",\r\n        \"lon\": 11.028771,\r\n        \"lat\": 50.977723\r\n    },\r\n    \"type_id\": \"your-vehicle-type-id\"\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">If you want your vehicle to end at a specified end-location which is not equal to the start-location, specify it as shown below:<\/span><\/p>\n<pre>{\r\n    \"vehicle_id\": \"your-vehicle-id\",\r\n    \"start_address\": {\r\n        \"location_id\": \"your-start-location-id\",\r\n        \"lon\": 11.028771,\r\n        \"lat\": 50.977723\r\n    },\r\n    \"end_address\": {\r\n         \"location_id\": \"your-end-location-id\",\r\n         \"lon\": 12.028771,\r\n         \"lat\": 54.977723\r\n    },\r\n    \"type_id\": \"your-vehicle-type-id\"\r\n}\r\n<\/pre>\n<p>If you want to let GraphHopper decide at which customer location the vehicle should end, specify it as shown below\u00a0(then the vehicle will end at one of your customer locations):<\/p>\n<pre>{\r\n    \"vehicle_id\": \"your-vehicle-id\",\r\n    \"start_address\": {\r\n        \"location_id\": \"your-start-location-id\",\r\n        \"lon\": 11.028771,\r\n        \"lat\": 50.977723\r\n    },\r\n    \"return_to_depot\": false,\r\n    \"type_id\": \"your-vehicle-type-id\"\r\n}\r\n<\/pre>\n<p><strong><span style=\"font-weight: 400\">Here <em>lat<\/em> and\u00a0<em>lon<\/em> refer\u00a0to latitude and longitude of a given location.<\/span><\/strong><\/p>\n<p><b>Vehicle Types:<\/b><br \/>\n<span style=\"font-weight: 400\">The default vehicle type is mentioned below.<\/span><\/p>\n<pre>{\r\n    \"type_id\": \"default_type\",\r\n    \"profile\": \"car\",\r\n    \"capacity\": [ 0 ],\/\/optional\r\n    \"speed_factor\": 1.0,\/\/optional\r\n    \"service_time_factor\": 1.0\/\/optional\r\n}\r\n<\/pre>\n<h3><b>Services or Shipments<\/b><\/h3>\n<p><span style=\"font-weight: 400\">The basic difference between a Service and a Shipment is that while the Service involves only one location Shipment involves two locations, i.e. a pickup and a delivery location. A service can be specified as:<\/span><\/p>\n<pre>{\r\n     \"id\": \"service-id\",\r\n     \"type\": \"pickup\",\r\n     \"name\": \"meaningful-name\", \r\n     \"address\": {\r\n       \"location_id\": \"service-location-id\",\r\n       \"name\": \"Goethe Street 1\",\r\n       \"lon\": 9.999,\r\n       \"lat\": 53.552\r\n     }, \r\n     \"time_windows\": [ \r\n        {\r\n            \"earliest\": 0,\r\n            \"latest\": 3600\r\n        },\r\n        {\r\n            \"earliest\": 7200,\r\n            \"latest\": 10800\r\n        }\r\n     ],\r\n     \"allowed_vehicles\": [\"vehicle_1\", \"vehicle_2\"]\r\n}\r\n<\/pre>\n<p>Similarly, a shipment can be specified as:<\/p>\n<pre>{\r\n    \"id\": \"shipment-id\",\r\n    \"name\": \"meaningful-name\", \r\n    \"pickup\": {\r\n        \"address\": {\r\n            \"location_id\": \"your-pickup-location-id\",\r\n            \"name\": \"Johann Sebastian Bach Avenue 5\",\r\n            \"lon\": 12.1333333,\r\n            \"lat\": 54.0833333\r\n        },\r\n        \"time_windows\": [ \r\n            {\r\n                \"earliest\": 0.0,\r\n                \"latest\": 1000.0\r\n            } \r\n        ]\r\n    },\r\n    \"delivery\": {\r\n        \"address\": {\r\n            \"location_id\": \"your-delivery-location-id\",\r\n            \"name\": \"Thomas Mann Street 1\",\r\n            \"lon\": 8.3858333,\r\n            \"lat\": 49.0047222\r\n        },\r\n        \"time_windows\": [ \r\n            {\r\n                \"earliest\": 10000.0,\r\n                \"latest\": 20000.0\r\n            }\r\n        ]\r\n    },\r\n    \"allowed_vehicles\": [\"vehicle_1\", \"vehicle_2\"] }<\/pre>\n<h4><b>A Full specification of some important fields of service object:<\/b><\/h4>\n<p><strong>type:\u00a0<\/strong>It is a string and a default <strong>service.\u00a0<\/strong>type can be specified as service, pickup or delivery. When the\u00a0type is service or pickup, items are loaded and stay in the vehicle for the rest of route.\u00a0If it is,\u00a0<code>delivery<\/code> items are implicitly loaded at the beginning of the route and will stay on the route until <code>delivery<\/code><\/p>\n<p><strong>time_windows:\u00a0<\/strong>It is an array. If a delivery needs to be carried out between a specific period of time, for example, between 7 am and 9 am then specify the array as follows: [ { &#8220;earliest&#8221;: 25200, &#8220;latest&#8221;: 32400 } ].\u00a0If the delivery facility has a lunch break and is open from 9am to 12am and 2pm to 6pm, just define the time windows as follows: [ { &#8220;earliest&#8221;: 32400, &#8220;latest&#8221; : 43200 }, { &#8220;earliest&#8221;: 50400, &#8220;latest&#8221; : 64800 } ]. If you need a time for the next day, add 24 hours, e.g. 7 am on the second day is 60*60*(7+24)=111600.<\/p>\n<p><strong>allowed_vehicles:\u00a0<\/strong>It is an array of vehicle Id&#8217;s (it\u00a0is vehicle_id created in vehicles array mentioned above).\u00a0if a\u00a0service can only be processed\u00a0EITHER by vehicle_1\u00a0OR vehicle_2 specify this as follows: [&#8220;vehicle_1&#8221;, &#8220;vehicle_2&#8221;].<\/p>\n<h2><b>JSON Output<\/b><\/h2>\n<p><span style=\"font-weight: 400\">If you post a problem, you either get back a job_id or an error. The job id looks as shown below:<\/span><\/p>\n<p><span style=\"font-weight: 400\">{ &#8220;<\/span><span style=\"font-weight: 400\">job_id<\/span><span style=\"font-weight: 400\">&#8220;: <\/span><span style=\"font-weight: 400\">&#8220;7ac65787-fb99-4e02-a832-2c3010c70097&#8221;<\/span><span style=\"font-weight: 400\"> }<\/span><\/p>\n<p><span style=\"font-weight: 400\">With the <\/span><span style=\"font-weight: 400\">job_id<\/span><span style=\"font-weight: 400\"> you can fetch your solution via <\/span><strong>https:\/\/graphhopper.com\/api\/1\/vrp\/solution\/[job_id]?key=[YOUR_KEY]<\/strong><\/p>\n<h3><b>Response<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Your job can be in three states. (a.)\u00a0if\u00a0your problem is still waiting (b.) if your job is being processed but not yet finished. In both cases you will get this:<\/span><\/p>\n<pre>{\r\n  \"job_id\" : \"7ac65787-fb99-4e02-a832-2c3010c70097\",\r\n  \"status\" : \"waiting\",\r\n  \"waiting_time_in_queue\" : 1061,\r\n  \"processing_time\" : 0,\r\n  \"solution\" : \"pending\"\r\n}\r\n<\/pre>\n<p>Lastly (c.) if your job is complete and a solution is available. You will consequently get this:<\/p>\n<pre>{\r\n  \"job_id\" : \"64963b20-d358-4f26-bf79-82decae50a2d\",\r\n  \"status\" : \"finished\",\r\n  \"waiting_time_in_queue\" : 0,\r\n  \"processing_time\" : 267,\r\n  \"solution\" : {\r\n     \"costs\": 58835,\r\n     \"distance\": 1898748,\r\n     \"time\": 58835,\r\n     \"transport_time\": 58835,\r\n     \"completion_time\": 58835,\r\n     \"max_operation_time\": 58835,\r\n     \"waiting_time\": 0,\r\n     \"no_vehicles\": 1,\r\n     \"no_unassigned\": 0,\r\n     \"routes\": [\r\n       {\r\n         \"vehicle_id\": \"my_vehicle\",\r\n         \"distance\": 1898748,\r\n         \"transport_time\": 58835,\r\n         \"completion_time\": 58835,\r\n         \"waiting_time\": 0,\r\n         \"activities\": [\r\n           {\r\n             \"type\": \"start\",\r\n             \"location_id\": \"berlin\",\r\n             \"address\": {\r\n               \"location_id\": \"berlin\",\r\n               \"lat\": 52.537,\r\n               \"lon\": 13.406\r\n             },\r\n             \"end_time\": 0,\r\n             \"distance\": 0,\r\n             \"driving_time\": 0,\r\n             \"load_after\": [\r\n               0\r\n             ]\r\n           },\r\n           {\r\n             \"type\": \"service\",\r\n             \"id\": \"munich\",\r\n             \"location_id\": \"munich\",\r\n             \"address\": {\r\n               \"location_id\": \"munich\",\r\n               \"name\": \"Meindlstra\u00dfe 11c\",\r\n               \"lat\": 48.145,\r\n               \"lon\": 11.57\r\n             },\r\n             \"arr_time\": 17985,\r\n             \"end_time\": 17985,\r\n             \"waiting_time\": 0,\r\n             \"distance\": 587746,\r\n             \"driving_time\": 17985,\r\n             \"load_before\": [\r\n               0\r\n             ],\r\n             \"load_after\": [\r\n               0\r\n             ]\r\n           },\r\n           {\r\n             \"type\": \"service\",\r\n             \"id\": \"frankfurt\",\r\n             \"location_id\": \"frankfurt\",\r\n             \"address\": {\r\n               \"location_id\": \"frankfurt\",\r\n               \"name\": \"Thomas Mann Stra\u00dfe 24\",\r\n               \"lat\": 50.109,\r\n               \"lon\": 8.67\r\n             },\r\n             \"arr_time\": 30991,\r\n             \"end_time\": 30991,\r\n             \"waiting_time\": 0,\r\n             \"distance\": 1001605,\r\n             \"driving_time\": 30991,\r\n             \"load_before\": [\r\n               0\r\n             ],\r\n             \"load_after\": [\r\n               0\r\n             ]\r\n           },\r\n           {\r\n             \"type\": \"service\",\r\n             \"id\": \"cologne\",\r\n             \"location_id\": \"cologne\",\r\n             \"address\": {\r\n               \"location_id\": \"cologne\",\r\n               \"name\": \"Friedrichstra\u00dfe 10\",\r\n               \"lat\": 50.936,\r\n               \"lon\": 6.957\r\n             },\r\n             \"arr_time\": 37004,\r\n             \"end_time\": 37004,\r\n             \"waiting_time\": 0,\r\n             \"distance\": 1189526,\r\n             \"driving_time\": 37004,\r\n             \"load_before\": [\r\n               0\r\n             ],\r\n             \"load_after\": [\r\n               0\r\n             ]\r\n           },\r\n           {\r\n             \"type\": \"service\",\r\n             \"id\": \"hamburg\",\r\n             \"location_id\": \"hamburg\",\r\n             \"address\": {\r\n               \"location_id\": \"hamburg\",\r\n               \"name\": \"Goethestra\u00dfe 1\",\r\n               \"lat\": 53.552,\r\n               \"lon\": 9.999\r\n             },\r\n             \"arr_time\": 49575,\r\n             \"end_time\": 49575,\r\n             \"waiting_time\": 0,\r\n             \"distance\": 1612006,\r\n             \"driving_time\": 49575,\r\n             \"load_before\": [\r\n               0\r\n             ],\r\n             \"load_after\": [\r\n               0\r\n             ]\r\n           },\r\n           {\r\n             \"type\": \"end\",\r\n             \"location_id\": \"berlin\",\r\n             \"address\": {\r\n               \"location_id\": \"berlin\",\r\n               \"lat\": 52.537,\r\n               \"lon\": 13.406\r\n             },\r\n             \"arr_time\": 58835,\r\n             \"distance\": 1898748,\r\n             \"driving_time\": 58835,\r\n             \"load_before\": [\r\n               0\r\n             ]\r\n           }\r\n         ]\r\n       }\r\n     ],\r\n     \"unassigned\": {\r\n       \"services\": [],\r\n       \"shipments\": [],\r\n       \"breaks\": []\r\n     }\r\n   }\r\n  }\r\n<\/pre>\n<p>To\u00a0explore more, <a href=\"https:\/\/graphhopper.com\/api\/1\/docs\/route-optimization\/\">please visit here<\/a><\/p>\n<p>In this way, you can easily get router data within a specified time-frame and efficient vehicles.\u00a0Hope this blog was helpful to you. Keep watching this space for more blogs on technology and API updates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Software engineers and organizations lookout for effective ways\u00a0to create new applications that save time and money. We can easily do this by using third-party software tools and SDKs. This blog is to spread awareness about a useful routing API\u00a0GraphHopper,\u00a0a third party SDK. I am working on a project which is based on routing and delivery [&hellip;]<\/p>\n","protected":false},"author":810,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":11},"categories":[1185,1],"tags":[4337,4336,4338,1418,4339],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/42283"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/810"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=42283"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/42283\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=42283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=42283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=42283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}