Routing

FATOS Routing is...

FATOS route is is real-time and user-friendly, and path search is possible with simple mouse clicks.

Directions Requests

Description

To find a route through the FATOS MAP API, you need to make a separate server call to get the results. The directions service is asynchronous. To request directions, call four values : Start point, Destiantion, Cartype and waypoint(optional). As a result,The route will be drawn as the point value of the overview_polyline among the json data provided as the result. However, for the normal use of the directions function, the issued key is required. This key is managed separately from the Map API key. Please contact FATOS Sales Group for key usage.(sales@fatoscorp.com)

    < Request >
    https://maps.fatos.biz/fatos/api/rp?key=[VALUE]&car=1&origin=[VALUE]&destination=[VALUE]&via=[VALUE]

    < Response >
    {
        bounds : { }
        legs : { }
        overview_polyline : { ...., points:VALUE}
        rpoption : { }
    }

Check the result value

{
    "routes": [
        {
            "rpoption": 1,
            "bounds": {
                "lefttop": {
                    "lon": 126.800810,
                    "lat": 37.557734
                },
                "rightbottom": {
                    "lon": 126.976813,
                    "lat": 37.576134
                }
            },
            "legs": [
                {
                    "distance": {
                        "text": "21.1 km",
                        "value": 21132
                    },
                    "duration": {
                        "text": "47 min",
                        "value": 2863
                    },
                    "end_location": {
                        "lon": 126.801941,
                        "lat": 37.561829
                    },
                    "start_location": {
                        "lon": 126.976807,
                        "lat": 37.575928
                    },
                    "step": [
                        {
                            "distance": {
                                "text": "0 m",
                                "value": 0
                            },
                            "duration": {
                                "text": "0 sec",
                                "value": 0
                            },
                            "end_location": {
                                "lon": 126.976813,
                                "lat": 37.575743
                            },
                            "start_location": {
                                "lon": 126.976813,
                                "lat": 37.575743
                            },
                            "polyline": {
                                "points": "k_jdFad_fW"
                            },
                            "instructions": "출발지",
                            "roadcategory": 8,
                            "roadname": "사직로",
                            "maneuver": 49
                        },
                        {
                            "distance": {
                                "text": "0.9 km",
                                "value": 986
                            },
                            "duration": {
                                "text": "4 min",
                                "value": 256
                            },
                            "end_location": {
                                "lon": 126.966504,
                                "lat": 37.574201
                            },
                            "start_location": {
                                "lon": 126.976813,
                                "lat": 37.575743
                            },
                            "polyline": {
                                "points": "k_jdFad_fW@|@?lEEjFEdAGfAM`CGbAG`BGzAElBEnCD`CDj@?HH`@@BDJPTXXp@~@dCxDn@|@Xj@Pn@R|@DX"
                            },
                            "instructions": "사직로 방면| 오른쪽 도로",
                            "roadcategory": 8,
                            "roadname": "사직로",
                            "maneuver": 13
                        },
                        {...}
                    ]
                }
            ],
            "overview_polyline": {
                "points_count": 428,
                "points": "k_jdFad_fW@|@?lEEjFEdAGfAM`CGbAG`BGzAElBEnCD`CDj@?HH`@@BDJPTXXp@~@dCxDn@|@Xj@Pn@R|@DXBh@PdAH\\FXdA~A`@f@n@x@zBlCDHL^D^?RAvBPtAIfFDjANbAx@rBVf@HR~@~A\\dALn@RpAB\\DZ@R@P?R@R?R?R?RAPCzCOx@CzA@f@@^Dj@`@|BnAjHlBhHtAtEjC~G`@`A^p@X`@RTNJzAh@x@d@jGzDzHfFfB~A`@~@bB~BhCjDvC~DpBnC|DlF`@t@JVHZFXDXBjC@zA@|@?V@rB@~ACxBAb@IvBUpDEXQr@a@nAy@bBi@n@SRyEhFw@x@eAlAk@r@}AjBaAhAqGpHY\\UTIN}@fBg@~AMj@WnAObACPC`@AZEpEEzCA|@AnAI|AC^a@bE?B?@Lf@?B?@M|A]vCi@jC[tAa@lBEb@Ep@A\\@h@Ht@Hv@Rt@L\\`@|@lBrD^x@p@|B\\`BbB|I\\fBh@pCJj@`CzM`@zBJh@VbAnBxI~ApIxBvLZjCd@vBnAjElAvDzBpHz@rBNj@P\\fCvHL|@DZ@`@@^?`@C^G`@G\\IZSn@Sd@]v@kBfDqAxBuBxCO^_@fAW|@Y~@sB|EyA~Dk@lAk@jAa@|@e@hAo@rA}@jBw@|AaAtBmAfCoAdCuAxCg@dACDy@`BQ`@MVeAxBw@~A_AlB_@v@aApBi@hA]p@}AdDmAbCo@rAsC|Fm@nA_@t@EHS`@aApByBpEi@fAm@lAcAtBaAnBaApBeAxBk@XIFILy@pAWb@kAjCq@rA}CpGk@jAGNCHERANAH?J@H?FBJFRDHDFFFFFFBFBFBF@J@JALCDAPKLK`@Yn@c@TMd@UPIXKNCRCT?T@PBNDXJ\\NtCpAd`@pWh@j@~@hALTFLHTDVDV@P?ZCXE`@IXKRIPa@dA]~@IXGRI^Id@SvA_@xBCNmBvDWj@kAbDsTbd@aBhDkAvAkD~GWz@CbAF`@Vb@`A~@dFvE\\VPHJBHD\\Lh@HzBXh@DfCXz@J`CXtDh@xAV~G`AnCl@tDx@nIhBzFpAxFlAvEfAxA`@l@LR`@Zp@FRGdA}A`WCr@APE~@UzFa@jJ{@vOCf@AREx@m@|Pa@nJWnEEd@AVEbAaAxRKvBIdCWdGCd@M~CCb@C^Ch@KlBYxEGjAUfE]bHGx@AZKzAG`ACt@KxCs@zMM|B@FDx@MbD?J@HDHBFj@l@ZVfBfCDEV[fJ{LnH{JPYF]@_@A[M]u@iAIMeAgA_BL}B`@]HUNw@dAeE~E??kAPo@CG@GBEBCDCFc@pK?L@JP`A@H?V"
            }
        }
    ],
    "status": "OK"
}

Get directions via waypoints

As stated in Directions Request, you can specify waypoints when requesting directions. When you add waypoints, the waypoints You can calculate the route and the returned route will pass through the waypoint you specify. At this time, route search is done in the order of waypoints specified. And so on. When requesting such a directions service, if an option is requested with rpoption = 35, the route based on the current option is optimized and returned.

  • rpoption : 1(recommendation1), 2(recommendation2), 4(highway priority), 8(generalroad priority), 16(shortest distance), 32(freeroad), 64(exclude caronly)

Example

< Request >
https://maps.fatos.biz/fatos/api/rp?rpoption=[Sum of each option value]&origin=[VALUE]&destination=[VALUE]&via=[VALUE]&key=[VALUE]

Display of Directions results

Description

After you receive the requested results, you must decode the result into a geometry code. Call the Fatos.polyLine() function as the decoded result and display the result on the map.

Result item of requested directions

The default directions route will contain a single result from the specified start point and destination. This route is the designation of the waypoint and/or the corresponding additional option. This can include multiple results rather than a single result.

  • legs : Contains an array of specified instructionsLeg object. Each object(single or multiple) contains information about the section of the route at two location within a given route. There is a separate interval for each given waypoint or destination.
  • overview_polyline : A set of single point objects containing encoded polyline representations of the extracted route. Theis polyline is the approximate route that results.
  • bounds : Bounds value, including latitude, longitude, representing the polyline boundary along the given route.