I'm currently working on a project using google maps Directions API on Android.
When i make any direction request i get a response such as this one
I'm actually able to decode the point's to get a List of subsequent LatLng coordinates to reach. Now i need to understand for each path between two subsequent LatLng points if it's an highway street(you had to pay to get there) or a normal street.
I don't think there's any way of doing so from this response. Is there any other parameter i can use to show this information? or maybe is there any other api i can use?
{
"geocoded_waypoints" : [
{
"geocoder_status" : "OK",
"place_id" : "ChIJBVcXiwukOxMRaaVJcZxIGXQ",
"types" : [ "locality", "political" ]
},
{
"geocoder_status" : "OK",
"place_id" : "ChIJ76RLkZW8OxMRpBS0rnKK0dI",
"types" : [ "locality", "political" ]
}
],
"routes" : [
{
"bounds" : {
"northeast" : {
"lat" : 40.7912565,
"lng" : 14.498954
},
"southwest" : {
"lat" : 40.7461626,
"lng" : 14.3675599
}
},
"copyrights" : "Dati mappa ©2018 Google",
"legs" : [
{
"distance" : {
"text" : "14,6 km",
"value" : 14606
},
"duration" : {
"text" : "21 min",
"value" : 1244
},
"end_address" : "80045 Pompei NA, Italia",
"end_location" : {
"lat" : 40.7461626,
"lng" : 14.498954
},
"start_address" : "80059 Torre del Greco NA, Italia",
"start_location" : {
"lat" : 40.7893898,
"lng" : 14.3675599
},
"steps" : [
{
"distance" : {
"text" : "0,3 km",
"value" : 260
},
"duration" : {
"text" : "1 min",
"value" : 71
},
"end_location" : {
"lat" : 40.7912565,
"lng" : 14.3694103
},
"html_instructions" : "Procedi in direzione \u003cb\u003enordest\u003c/b\u003e da \u003cb\u003eStrada Statale 18 Tirrena Inferiore\u003c/b\u003e/\u003cb\u003eSR18\u003c/b\u003e verso \u003cb\u003eTraversa I Vittorio Veneto\u003c/b\u003e",
"polyline" : {
"points" : "ut}wFgduvAe@c@WUKMa@]MOi@i@kCkCeAeA"
},
"start_location" : {
"lat" : 40.7893898,
"lng" : 14.3675599
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "0,9 km",
"value" : 932
},
"duration" : {
"text" : "3 min",
"value" : 162
},
"end_location" : {
"lat" : 40.7846057,
"lng" : 14.3756157
},
"html_instructions" : "Svolta a \u003cb\u003edestra\u003c/b\u003e per rimanere su \u003cb\u003eStrada Statale 18 Tirrena Inferiore\u003c/b\u003e/\u003cb\u003eSR18\u003c/b\u003e",
"maneuver" : "turn-right",
"polyline" : {
"points" : "k`~wFyouvA~@}AhA{AdCcDhBaCd@o@tByCnAaBt@_ALQHMRUBCPOb@Qf@Gb@EVEr@KPGTG^WFILMNMLM`AeAp@s@RWLIJGNEJETAl@GXB"
},
"start_location" : {
"lat" : 40.7912565,
"lng" : 14.3694103
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "1,0 km",
"value" : 973
},
"duration" : {
"text" : "2 min",
"value" : 123
},
"end_location" : {
"lat" : 40.7908857,
"lng" : 14.3829714
},
"html_instructions" : "Svolta a \u003cb\u003esinistra\u003c/b\u003e e prendi \u003cb\u003eVia Cavallo\u003c/b\u003e",
"maneuver" : "turn-left",
"polyline" : {
"points" : "yv|wFsvvvACOCICICGO_@w@qAKOCGCICICISmAG_@CMEMCGAE_AoAkCgDoB}Bi@o@i@c@GGEECEYg@e@{@UYY[y@eAk@m@OQUWQKMEs@NMDSBK?IAECSOa@k@]a@ECMGSISQECg@q@IG{@qAAGQ_@"
},
"start_location" : {
"lat" : 40.7846057,
"lng" : 14.3756157
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "0,2 km",
"value" : 202
},
"duration" : {
"text" : "1 min",
"value" : 35
},
"end_location" : {
"lat" : 40.7897602,
"lng" : 14.3848068
},
"html_instructions" : "Alla rotonda prendi la \u003cb\u003e1ª\u003c/b\u003e uscita e prendi lo svincolo \u003cb\u003eA3\u003c/b\u003e/\u003cb\u003eE45\u003c/b\u003e per \u003cb\u003eAutostrade\u003c/b\u003e\u003cdiv style=\"font-size:0.9em\"\u003eStrada a pedaggio parziale\u003c/div\u003e",
"maneuver" : "roundabout-right",
"polyline" : {
"points" : "a~}wFqdxvA@C?C?E?E?C?ETe@b@y@x@}AbA}Af@u@"
},
"start_location" : {
"lat" : 40.7908857,
"lng" : 14.3829714
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "9,9 km",
"value" : 9941
},
"duration" : {
"text" : "7 min",
"value" : 402
},
"end_location" : {
"lat" : 40.7495621,
"lng" : 14.476954
},
"html_instructions" : "Mantieni la \u003cb\u003esinistra\u003c/b\u003e al bivio, segui le indicazioni per \u003cb\u003eE45\u003c/b\u003e/\u003cb\u003eSalerno\u003c/b\u003e/\u003cb\u003eReggio C.\u003c/b\u003e ed entra in \u003cb\u003eA3\u003c/b\u003e/\u003cb\u003eE45\u003c/b\u003e\u003cdiv style=\"font-size:0.9em\"\u003eStrada a pedaggio\u003c/div\u003e",
"maneuver" : "fork-left",
"polyline" : {
"points" : "_w}wFapxvAV_@DEPQLIPIVKRGPEPCPAX?H@N@VFPDNHPHVRPPJLLRLRP\\Vv@j@bBn@|BH`@DZBX@T@X?PAN?LCXCRCRGVGPGRKVMTKRMLGHIFIDGBI@I@GAIAGAGEIEEEEGEKEKAKCI?K?K?I@K?G@KBMBGDM@??APy@dBeDTc@Tg@Vg@zEoJJUFMTa@^u@p@iAb@w@x@qAn@{@rA_B~@aAbB}A`DqCfByAJKdBuAdA_A`A}@j@s@zAuBt@iAXg@Ta@Te@HQLYNa@Rw@^yAf@sBdAiERw@p@}Bz@eDl@gCr@yCj@eC`AcELe@Je@ViAt@}Cl@aCZwATeAp@{Ch@_CpAsFr@iCt@oCb@_B|@mDLi@J[H[tA_Fl@wBFUrA{E~@gDl@wB^wA~BoIDQFSdCyIf@iBVaANi@l@gCx@aEb@kBBMh@eCDYLc@XcATs@Ng@Lc@Na@Ja@Z{AJe@H_@F]XqA^wBVyAJq@Ns@Po@n@_CRq@p@oCz@aEZqADO?CFQrA{FBIDSBKJ_@r@oClA{EZsAFWFWfA{Ev@}Dx@wD?CH[?AF[b@kBlBkIdAcFdAmE|@uDZuAHe@XyAJw@H}@HmBF_DBiD@_@?a@HyHDmEHgEDu@Bk@Fi@Fw@^cCJk@Lk@ZgArAwDPg@p@aBdBiF?A@CFOh@{An@iBH[t@qB@GFOBIJ[^cA|@aC^cAjAwCt@kBfAoCjAuC@A`AaC~C}HpAcDn@aBv@wBt@sB`AsCbBcFBEJY?AJYfAsCzAcE|AgEvBaGx@aCzB}FlDgJXs@n@gB"
},
"start_location" : {
"lat" : 40.7897602,
"lng" : 14.3848068
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "0,2 km",
"value" : 212
},
"duration" : {
"text" : "1 min",
"value" : 32
},
"end_location" : {
"lat" : 40.7482728,
"lng" : 14.4784155
},
"html_instructions" : "Prendi l'uscita \u003cb\u003ePompei\u003c/b\u003e verso \u003cb\u003ePompei\u003c/b\u003e/\u003cb\u003ePompei Ovest\u003c/b\u003e",
"maneuver" : "ramp-right",
"polyline" : {
"points" : "w{uwF}ojwARKBCBEL_@Vk@\\q@`@{@Rk@Pc@HQDCDCFCDCF@D@D@@@FBVN"
},
"start_location" : {
"lat" : 40.7495621,
"lng" : 14.476954
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "1,0 km",
"value" : 991
},
"duration" : {
"text" : "3 min",
"value" : 169
},
"end_location" : {
"lat" : 40.7471718,
"lng" : 14.489806
},
"html_instructions" : "Svolta a \u003cb\u003esinistra\u003c/b\u003e e prendi \u003cb\u003eStrada Statale 18 Tirrena Inferiore\u003c/b\u003e/\u003cb\u003eSR18\u003c/b\u003e",
"maneuver" : "turn-left",
"polyline" : {
"points" : "usuwFcyjwATwAPuAJw@JaAJcAPcBDc@Hk@Lm@TcA`@iBr@cDN{@j@qD?GFcAB{@IaBq@yNSiEEkABWAeA"
},
"start_location" : {
"lat" : 40.7482728,
"lng" : 14.4784155
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "0,5 km",
"value" : 520
},
"duration" : {
"text" : "2 min",
"value" : 102
},
"end_location" : {
"lat" : 40.74907,
"lng" : 14.4952359
},
"html_instructions" : "Alla rotonda prendi la \u003cb\u003e2ª\u003c/b\u003e uscita e prendi \u003cb\u003eVia Plinio\u003c/b\u003e",
"maneuver" : "roundabout-right",
"polyline" : {
"points" : "yluwFi`mwA@??A@A?A@??A?A?A?A?A?A?A?A?AA??A?AA??AA??AA??AA?A?A?A?A??@A?KQGCeAsCQi@kCuGMs@OaA?Cg@kEi@kEEa@"
},
"start_location" : {
"lat" : 40.7471718,
"lng" : 14.489806
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "0,2 km",
"value" : 198
},
"duration" : {
"text" : "1 min",
"value" : 62
},
"end_location" : {
"lat" : 40.7493801,
"lng" : 14.4975391
},
"html_instructions" : "Continua su \u003cb\u003eVia Roma\u003c/b\u003e",
"polyline" : {
"points" : "uxuwFgbnwAEW?EKu@Kw@KaAGeACa@Aa@EsB"
},
"start_location" : {
"lat" : 40.74907,
"lng" : 14.4952359
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "0,3 km",
"value" : 324
},
"duration" : {
"text" : "1 min",
"value" : 78
},
"end_location" : {
"lat" : 40.7466072,
"lng" : 14.4987269
},
"html_instructions" : "Svolta a \u003cb\u003edestra\u003c/b\u003e e prendi \u003cb\u003eVia Vittorio Emanuele\u003c/b\u003e",
"maneuver" : "turn-right",
"polyline" : {
"points" : "szuwFspnwAlC{@zAc@rC_ArBm@ZMZQ"
},
"start_location" : {
"lat" : 40.7493801,
"lng" : 14.4975391
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "53 m",
"value" : 53
},
"duration" : {
"text" : "1 min",
"value" : 8
},
"end_location" : {
"lat" : 40.7461626,
"lng" : 14.498954
},
"html_instructions" : "Continua su \u003cb\u003eVia Antonio Morese\u003c/b\u003e",
"polyline" : {
"points" : "iiuwFaxnwAdAc@RG"
},
"start_location" : {
"lat" : 40.7466072,
"lng" : 14.4987269
},
"travel_mode" : "DRIVING"
}
],
"traffic_speed_entry" : [],
"via_waypoint" : []
}
],
"overview_polyline" : {
"points" : "ut}wFgduvAkBeBiGkG~@}AhA{AnFeHzCiEdCaDn@y@POb@QjAMjAQf@OdA}@`CgC`@a@ZM`@Gl@GXBGYGQgAqBOWGSWwAUcAaAuA{FeHi@o@i@c@MM]m@{@uAoCaDUWQKMEs@Na@HUAYS_AmASKg@[m@u@eAyASg@@G?Ux@_Bx@}AbA}A~@uAVW^Sj@Sb@Ij@AXBh@L`@Rh@d@X`@^p@bAzCx@~CHt@Bn@EhAGf@Oh@Sj@Yh@UVSLQDQ?QCQKKMKWEm@Bi@Nc@P{@zBiEtGuMnBoD|AiCbC{CbD_DhGkFpBaBfC}BfCiDnAqBbAsBb@yAfAmExAaGlBcHnEkRfBsHpC{LzBsJhByGzBsIvJ}]rGoU~@kD|@qDjCaMR}@n@wBx@oCx@_Ex@iEb@kC`@cBbAqDp@oCz@aE`@aB~A{GhAoExB_JfA{Ev@}Dx@{Dt@eDrDoPbCcKd@{Bd@qCRkDJiIPiQN}FJuAf@{DXwAZgArAwDbAiCnB_GrDqKhEaLjEsKbJeUlBkFdDwJZ{@xJaXtD_KfE{Kn@gBRKFId@kA~@mBd@oANULGLATHVNTwA\\mCn@mGVyAv@mDbA_Fj@yDJ_C{@{QYuGBWAeA@??A@C@GEQEAC?A?MOGCeAsC}C_I]uBg@oEu@kGWmBSgCEcAEsBlC{@nFcBnC{@tB}@"
},
"summary" : "A3/E45",
"warnings" : [],
"waypoint_order" : []
}
],
"status" : "OK"
}