RoadAPI 샘플예제

이동한도로찾기

  • REQUEST (CURL / POST)

curl --request POST \ --url 'https://apis.openapi.sk.com/tmap/road/matchToRoads?version=1' \ --header 'Accept: application/json'
  • REQUEST (SAMPLE CODE)

POST /tmap/routes HTTP/1.1 Host: apis.openapi.sk.com appKey: 1234-5678-9012-3456 Accept-Language: ko Content-Type: application/x-www-form-urlencoded responseType=1&coords=126.87793387437,35.237431207701|126.87819495169,35.237856164051|126.87844491764,35.238331114558|126.87871432615,35.23881162032|126.87900595473,35.239300458849|126.87930591512,35.239819849619|126.8796392052,35.240367015588|126.87994472025
  • RESPONSE (200 | application/json)

{ "resultData": { "header": { "totalDistance": 289, "totalPointCount": 10, "matchedLinkCount": 2 }, "matchedPoints": [ { "linkId": "5601", "matchedLocation": { "latitude": 35.237475, "longitude": 126.87785277777777 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.237431207701, "longitude": 126.87793387436998 }, "sourceIndex": 0, "speed": 80, "roadCategory": 5 }, { "idxName": "44830000", "linkId": "5601", "matchedLocation": { "latitude": 35.23786944444444, "longitude": 126.87809444444444 }, "speed": 80, "roadCategory": 5 }, { "idxName": "44830000", "linkId": "5602", "matchedLocation": { "latitude": 35.23786944444444, "longitude": 126.87809444444444 }, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.2379, "longitude": 126.87811388888889 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.237856164051, "longitude": 126.87819495169 }, "sourceIndex": 1, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23836388888889, "longitude": 126.87838055555555 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.238331114558, "longitude": 126.87844491763998 }, "sourceIndex": 2, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.238841666666666, "longitude": 126.87865833333333 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.23881162032, "longitude": 126.87871432615002 }, "sourceIndex": 3, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.239333333333334, "longitude": 126.87894166666666 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.239300458849, "longitude": 126.87900595473002 }, "sourceIndex": 4, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23985277777778, "longitude": 126.87924444444444 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.239819849619, "longitude": 126.87930591512 }, "sourceIndex": 5, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23985277777778, "longitude": 126.87924444444444 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.240367015588, "longitude": 126.8796392052 }, "sourceIndex": 6, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23985277777778, "longitude": 126.87924444444444 }, "idxName": "44830000", "sourceLocation": { "latitude": 3, "longitude": 126.87994472025 }, "sourceIndex": 7, "speed": 80, "roadCategory": 5 } ] } }



이동한도로찾기 500

  • REQUEST (CURL / POST)

curl --request POST \ --url 'https://apis.openapi.sk.com/tmap/road/matchToRoads500?version=1' \ --header 'Accept: application/json'
  • REQUEST (SAMPLE CODE)

POST /tmap/routes HTTP/1.1 Host: apis.openapi.sk.com appKey: 1234-5678-9012-3456 Accept-Language: ko Content-Type: application/x-www-form-urlencoded responseType=1&coords=126.87793387437,35.237431207701|126.87819495169,35.237856164051|126.87844491764,35.238331114558|126.87871432615,35.23881162032|126.87900595473,35.239300458849|126.87930591512,35.239819849619|126.8796392052,35.240367015588|126.87994472025
  • RESPONSE (200 | application/json)

{ "resultData": { "header": { "totalDistance": 289, "totalPointCount": 10, "matchedLinkCount": 2 }, "matchedPoints": [ { "linkId": "5601", "matchedLocation": { "latitude": 35.237475, "longitude": 126.87785277777777 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.237431207701, "longitude": 126.87793387436998 }, "sourceIndex": 0, "speed": 80, "roadCategory": 5 }, { "idxName": "44830000", "linkId": "5601", "matchedLocation": { "latitude": 35.23786944444444, "longitude": 126.87809444444444 }, "speed": 80, "roadCategory": 5 }, { "idxName": "44830000", "linkId": "5602", "matchedLocation": { "latitude": 35.23786944444444, "longitude": 126.87809444444444 }, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.2379, "longitude": 126.87811388888889 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.237856164051, "longitude": 126.87819495169 }, "sourceIndex": 1, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23836388888889, "longitude": 126.87838055555555 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.238331114558, "longitude": 126.87844491763998 }, "sourceIndex": 2, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.238841666666666, "longitude": 126.87865833333333 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.23881162032, "longitude": 126.87871432615002 }, "sourceIndex": 3, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.239333333333334, "longitude": 126.87894166666666 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.239300458849, "longitude": 126.87900595473002 }, "sourceIndex": 4, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23985277777778, "longitude": 126.87924444444444 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.239819849619, "longitude": 126.87930591512 }, "sourceIndex": 5, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23985277777778, "longitude": 126.87924444444444 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.240367015588, "longitude": 126.8796392052 }, "sourceIndex": 6, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23985277777778, "longitude": 126.87924444444444 }, "idxName": "44830000", "sourceLocation": { "latitude": 3, "longitude": 126.87994472025 }, "sourceIndex": 7, "speed": 80, "roadCategory": 5 } ] } }



이동한도로찾기 1000

  • REQUEST (CURL / POST)

curl --request POST \ --url 'https://apis.openapi.sk.com/tmap/road/matchToRoads1000?version=1' \ --header 'Accept: application/json'
  • REQUEST (SAMPLE CODE)

POST /tmap/routes HTTP/1.1 Host: apis.openapi.sk.com appKey: 1234-5678-9012-3456 Accept-Language: ko Content-Type: application/x-www-form-urlencoded responseType=1&coords=126.87793387437,35.237431207701|126.87819495169,35.237856164051|126.87844491764,35.238331114558|126.87871432615,35.23881162032|126.87900595473,35.239300458849|126.87930591512,35.239819849619|126.8796392052,35.240367015588|126.87994472025
  • RESPONSE (200 | application/json)

{ "resultData": { "header": { "totalDistance": 289, "totalPointCount": 10, "matchedLinkCount": 2 }, "matchedPoints": [ { "linkId": "5601", "matchedLocation": { "latitude": 35.237475, "longitude": 126.87785277777777 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.237431207701, "longitude": 126.87793387436998 }, "sourceIndex": 0, "speed": 80, "roadCategory": 5 }, { "idxName": "44830000", "linkId": "5601", "matchedLocation": { "latitude": 35.23786944444444, "longitude": 126.87809444444444 }, "speed": 80, "roadCategory": 5 }, { "idxName": "44830000", "linkId": "5602", "matchedLocation": { "latitude": 35.23786944444444, "longitude": 126.87809444444444 }, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.2379, "longitude": 126.87811388888889 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.237856164051, "longitude": 126.87819495169 }, "sourceIndex": 1, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23836388888889, "longitude": 126.87838055555555 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.238331114558, "longitude": 126.87844491763998 }, "sourceIndex": 2, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.238841666666666, "longitude": 126.87865833333333 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.23881162032, "longitude": 126.87871432615002 }, "sourceIndex": 3, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.239333333333334, "longitude": 126.87894166666666 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.239300458849, "longitude": 126.87900595473002 }, "sourceIndex": 4, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23985277777778, "longitude": 126.87924444444444 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.239819849619, "longitude": 126.87930591512 }, "sourceIndex": 5, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23985277777778, "longitude": 126.87924444444444 }, "idxName": "44830000", "sourceLocation": { "latitude": 35.240367015588, "longitude": 126.8796392052 }, "sourceIndex": 6, "speed": 80, "roadCategory": 5 }, { "linkId": "5602", "matchedLocation": { "latitude": 35.23985277777778, "longitude": 126.87924444444444 }, "idxName": "44830000", "sourceLocation": { "latitude": 3, "longitude": 126.87994472025 }, "sourceIndex": 7, "speed": 80, "roadCategory": 5 } ] } }



RESPONSE (PARAMETERS)

  • 이동한도로찾기 / 500 / 1000 모두 동일한 Response Parameter를 사용합니다.

NameTypeMandatoryExampleDescription
headerNodeY
totalDistanceintY총 거리 (단위: m)
matchedLinkCountintY매칭된 링크의 개수 (단위: count)
totalPointCountintY총 좌표의 개수 (단위: count)
matchedPoints(body)NodeY매칭된 정보 데이터.
sourceLocationNodeN요청된 좌표 정보
latitudeStringN요청 좌표의 위도
longitudeStringN요청 좌표의 경도
sourceIndexintN요청된 좌표의 순번입니다.
보간점의 경우는
sourceIndex가 없습니다.
idxNameStringY링크의 Mesh Id
linkIdStringY매칭된 링크의 ID
roadCategoryintY원도로등급
(0:고속국도, 1:도시고속화도로,
2:국도, 3;국가지원지방도,
4:지방도, 5:주요도로 1,
6:주요도로 2, 7:주요도로 3,
8:기타도로 1, 9:이면도로,
10:페리항로, 11:단지내도로,
12 :이면도로 2(세도로))
speedintY매칭된 링크의 제한 속도 (Km/H)
endPointStringN매칭 종료 포인트
mathedLocationNodeY매칭된 좌표 정보입니다.
보간점의 경우는
이전의 매칭된 링크의 연결성을
유지하기 위한 정보입니다.
latitudeStringY매칭된 좌표의 위도
longitudeStringY매칭된 좌표의 경도