자율차전용지도 (제공)
자율차 전용지도를 제공합니다.
Last updated
자율차 전용지도를 제공합니다.
Last updated
자율차 전용지도는 ISO 22726-1 표준 포맷으로 인코딩되어 있습니다. 데이터 구조 확인 및 디코딩을 위해선 아래 ASN.1 파일을 다운로드 받아 활용해주시기 바랍니다.
https://service.mqnicrnd5.com/api/v1/am/offer/gti
요청 시
HTTPS
GET
API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. 접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.
> GET /api/v1/am/offer/gti?op=gti&version=1&lat=37.4790896&lon=127.0375223&tolLat=0.01&tolLon=0.01 HTTP/2
> Host: service.mqnicrnd5.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <접근 토큰>
curl --location 'https://service.mqnicrnd5.com/api/v1/am/offer/gti?op=gti&version=1&lat=37.4790896&lon=127.0375223&tolLat=0.01&tolLon=0.01' \
--header 'Authorization: Bearer <접근 토큰>'
{
"type": "tileIDList",
"tileIDList": [
{
"tileID": "557631891",
"dataVersion": "20200324163655"
}
]
}
https://service.mqnicrnd5.com/api/v1/am/offer/gamv
요청 시
HTTPS
GET
API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. 접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.
> GET /api/v1/am/offer/gamv?op=gamv&version=1&packageID=001&tileID=557631740 HTTP/2
> Host: service.mqnicrnd5.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <접근 토큰>
curl --location 'https://service.mqnicrnd5.com/api/v1/am/offer/gamv?op=gamv&version=1&packageID=001&tileID=557631740' \
--header 'Authorization: Bearer <접근 토큰>'
{
"type": "20230913161910",
"tileDataVersion": {
"tileID": "557631740",
"packageID": "001",
"dataVersion": "20230913161910",
"dataSpecVersion": null,
"filesize": null
}
}
https://service.mqnicrnd5.com/api/v1/am/offer/gamd
요청 시
HTTPS
GET
API를 요청할 때 다음 예와 같이 HTTP 요청 헤더에 접근 토큰(Access Token) 을 추가해야 합니다. 접근 토큰 앞에 "Bearer " 문자열을 추가해야 한다는 점에 주의하세요.
> GET /api/v1/am/offer/gamd?op=gamd&version=1&tileID=557631740 HTTP/2
> Host: service.mqnicrnd5.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <접근 토큰>
curl --location 'https://service.mqnicrnd5.com/api/v1/am/offer/gamd?op=gamd&version=1&tileID=557631740' \
--header 'Authorization: Bearer <접근 토큰>'
{
"type": "amData",
"hdMapData": {
"tileID": 557631740,
"fileType": "iso",
"mapData": "AAICO4oampubGZibmhgvmJgYr5gYGBgYGI..."
}
}
다음은 각 언어별 자율차 전용지도 제공 API 구현 예제입니다.
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.net.URL;
public class CallAPI {
public static void main(String[] args) {
String accessToken = "Bearer " + "<접근 토큰>";
String op = "gti";
String version = "1";
Double lat = 37.4790896;
Double lon = 127.0375223;
Double tolLat = 0.01;
Double tolLon = 0.01;
String apiURL = "https://service.mqnicrnd5.com/api/v1/am/offer/gti?"
+ "op=" + op + "&"
+ "version=" + version + "&"
+ "lat=" + lat + "&"
+ "lon=" + lon + "&"
+ "tolLat=" + tolLat + "&"
+ "tolLon=" + tolLon ;
Map<String, String> requestHeaders = new HashMap<>();
requestHeaders.put("Authorization", accessToken);
String responseBody = get(apiURL,requestHeaders);
System.out.println(responseBody);
}
private static String get(String apiUrl, Map<String, String> requestHeaders) {
HttpURLConnection con = connect(apiUrl);
try {
con.setRequestMethod("GET");
for (Map.Entry<String, String> header : requestHeaders.entrySet()) {
con.setRequestProperty(header.getKey(), header.getValue());
}
int responseCode = con.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) { // 정상 호출
return readBody(con.getInputStream());
} else { // 오류 발생
return readBody(con.getErrorStream());
}
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
con.disconnect();
}
}
private static HttpURLConnection connect(String apiUrl) {
try {
URL url = new URL(apiUrl);
return (HttpURLConnection) url.openConnection();
} catch (MalformedURLException e) {
throw new RuntimeException("API URL이 잘못되었습니다. : " + apiUrl, e);
} catch (IOException e) {
throw new RuntimeException("연결이 실패했습니다. : " + apiUrl, e);
}
}
private static String readBody(InputStream body) {
InputStreamReader streamReader = new InputStreamReader(body);
try (BufferedReader lineReader = new BufferedReader(streamReader)) {
StringBuilder responseBody = new StringBuilder();
String line;
while ((line = lineReader.readLine()) != null) {
responseBody.append(line);
}
return responseBody.toString();
} catch (IOException e) {
throw new RuntimeException("API 응답을 읽는 데 실패했습니다.", e);
}
}
}
import requests
import json
def send_get_request():
accessToken = "Bearer " + "<접근 토큰>"
op = "gti"
version = "1"
lat = 37.4790896
lon = 127.0375223
tolLat = 0.01
tolLon = 0.01
apiURL = "https://service.mqnicrnd5.com/api/v1/am/offer/gti?" \
+ "op=" + str(op) + "&" \
+ "version=" + str(version) + "&" \
+ "lat=" + str(lat) + "&" \
+ "lon=" + str(lon) + "&" \
+ "tolLat=" + str(tolLat) + "&" \
+ "tolLon=" + str(tolLon)
headers = {
"Authorization": accessToken
}
response = requests.get(apiURL, headers=headers)
print("GET Request:")
print("Response Code:", response.status_code)
print("Response:", response.text)
if __name__ == "__main__":
send_get_request()
const https = require('https');
function main() {
const accessToken = "Bearer <접근 토큰>";
const op = "gti";
const version = "1";
const lat = 37.4790896;
const lon = 127.0375223;
const tolLat = 0.01;
const tolLon = 0.01;
const apiURL = `https://service.mqnicrnd5.com/api/v1/am/offer/gti?op=${op}&version=${version}&lat=${lat}&lon=${lon}&tolLat=${tolLat}&tolLon=${tolLon}`;
const headers = {
'Authorization': accessToken
};
get(apiURL, headers)
.then(responseBody => {
console.log(responseBody);
})
.catch(error => {
console.error('Error:', error);
});
}
function get(apiURL, headers) {
return new Promise((resolve, reject) => {
const options = {
headers: headers
};
https.get(apiURL, options, response => {
let data = '';
response.on('data', chunk => {
data += chunk;
});
response.on('end', () => {
resolve(data);
});
}).on('error', error => {
reject(error);
});
});
}
main();
using System;
using System.IO;
using System.Net;
using System.Text;
class Program
{
static void Main(string[] args)
{
string accessToken = "Bearer <접근 토큰>";
string op = "gti";
string version = "1";
double lat = 37.4790896;
double lon = 127.0375223;
double tolLat = 0.01;
double tolLon = 0.01;
string apiURL = $"https://service.mqnicrnd5.com/api/v1/am/offer/gti?op={op}&version={version}&lat={lat}&lon={lon}&tolLat={tolLat}&tolLon={tolLon}";
string responseBody = Get(apiURL, accessToken);
Console.WriteLine(responseBody);
}
static string Get(string apiUrl, string accessToken)
{
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiUrl);
request.Method = "GET";
request.Headers["Authorization"] = accessToken;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
{
return reader.ReadToEnd();
}
}
catch (WebException e)
{
using (WebResponse response = e.Response)
using (Stream dataStream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(dataStream))
{
string errorResponse = reader.ReadToEnd();
throw new Exception($"Error occurred: {errorResponse}", e);
}
}
}
}
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.net.URL;
public class CallAPI {
public static void main(String[] args) {
String accessToken = "Bearer " + "<접근 토큰>";
String op = "gamv";
String version = "1";
String tileID = "557631740";
String packageID = "001";
String apiURL = "https://service.mqnicrnd5.com/api/v1/am/offer/gamv?"
+ "op=" + op + "&"
+ "version=" + version + "&"
+ "packageID=" + packageID + "&"
+ "tileID=" + tileID;
Map<String, String> requestHeaders = new HashMap<>();
requestHeaders.put("Authorization", accessToken);
String responseBody = get(apiURL,requestHeaders);
System.out.println(responseBody);
}
private static String get(String apiUrl, Map<String, String> requestHeaders) {
HttpURLConnection con = connect(apiUrl);
try {
con.setRequestMethod("GET");
for (Map.Entry<String, String> header : requestHeaders.entrySet()) {
con.setRequestProperty(header.getKey(), header.getValue());
}
int responseCode = con.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) { // 정상 호출
return readBody(con.getInputStream());
} else { // 오류 발생
return readBody(con.getErrorStream());
}
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
con.disconnect();
}
}
private static HttpURLConnection connect(String apiUrl) {
try {
URL url = new URL(apiUrl);
return (HttpURLConnection) url.openConnection();
} catch (MalformedURLException e) {
throw new RuntimeException("API URL이 잘못되었습니다. : " + apiUrl, e);
} catch (IOException e) {
throw new RuntimeException("연결이 실패했습니다. : " + apiUrl, e);
}
}
private static String readBody(InputStream body) {
InputStreamReader streamReader = new InputStreamReader(body);
try (BufferedReader lineReader = new BufferedReader(streamReader)) {
StringBuilder responseBody = new StringBuilder();
String line;
while ((line = lineReader.readLine()) != null) {
responseBody.append(line);
}
return responseBody.toString();
} catch (IOException e) {
throw new RuntimeException("API 응답을 읽는 데 실패했습니다.", e);
}
}
}
import requests
import json
def send_get_request():
accessToken = "Bearer " + "<접근 토큰>"
op = "gamv"
version = "1"
tileID = "557631740"
packageID = "001"
apiURL = "https://service.mqnicrnd5.com/api/v1/am/offer/gamv?" \
+ "op=" + str(op) + "&" \
+ "version=" + str(version) + "&" \
+ "packageID=" + str(packageID) + "&" \
+ "tileID=" + str(tileID)
headers = {
"Authorization": accessToken
}
response = requests.get(apiURL, headers=headers)
print("GET Request:")
print("Response Code:", response.status_code)
print("Response:", response.text)
if __name__ == "__main__":
send_get_request()
const axios = require('axios');
async function main() {
const accessToken = "Bearer <접근 토큰>";
const op = "gamv";
const version = "1";
const tileID = "557631740";
const packageID = "001";
const apiURL = `https://service.mqnicrnd5.com/api/v1/am/offer/gamv?op=${op}&version=${version}&packageID=${packageID}&tileID=${tileID}`;
const requestHeaders = {
'Authorization': accessToken
};
try {
const responseBody = await get(apiURL, requestHeaders);
console.log(responseBody);
} catch (error) {
console.error(error);
}
}
async function get(apiUrl, requestHeaders) {
try {
const response = await axios.get(apiUrl, { headers: requestHeaders });
return response.data;
} catch (error) {
throw new Error(`API 호출 중 오류 발생: ${error.message}`);
}
}
main();
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
class Program
{
static void Main(string[] args)
{
string accessToken = "Bearer <접근 토큰>";
string op = "gamv";
string version = "1";
string tileID = "557631740";
string packageID = "001";
string apiURL = $"https://service.mqnicrnd5.com/api/v1/am/offer/gamv?" +
$"op={op}&" +
$"version={version}&" +
$"packageID={packageID}&" +
$"tileID={tileID}";
Dictionary<string, string> requestHeaders = new Dictionary<string, string>();
requestHeaders.Add("Authorization", accessToken);
string responseBody = Get(apiURL, requestHeaders);
Console.WriteLine(responseBody);
}
private static string Get(string apiUrl, Dictionary<string, string> requestHeaders)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiUrl);
request.Method = "GET";
foreach (var header in requestHeaders)
{
request.Headers.Add(header.Key, header.Value);
}
try
{
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
if (response.StatusCode == HttpStatusCode.OK)
{
return reader.ReadToEnd();
}
else
{
throw new Exception($"Error response from API: {response.StatusCode}");
}
}
}
catch (WebException ex)
{
throw new Exception("API request failed.", ex);
}
}
}
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.net.URL;
public class CallAPI {
public static void main(String[] args) {
String accessToken = "Bearer " + "<접근 토큰>";
String op = "gamd";
String version = "1";
String tileID = "557631740";
String apiURL = "https://service.mqnicrnd5.com/api/v1/am/offer/gamd?"
+ "op=" + op + "&"
+ "version=" + version + "&"
+ "tileID=" + tileID;
Map<String, String> requestHeaders = new HashMap<>();
requestHeaders.put("Authorization", accessToken);
String responseBody = get(apiURL,requestHeaders);
System.out.println(responseBody);
}
private static String get(String apiUrl, Map<String, String> requestHeaders) {
HttpURLConnection con = connect(apiUrl);
try {
con.setRequestMethod("GET");
for (Map.Entry<String, String> header : requestHeaders.entrySet()) {
con.setRequestProperty(header.getKey(), header.getValue());
}
int responseCode = con.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) { // 정상 호출
return readBody(con.getInputStream());
} else { // 오류 발생
return readBody(con.getErrorStream());
}
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
con.disconnect();
}
}
private static HttpURLConnection connect(String apiUrl) {
try {
URL url = new URL(apiUrl);
return (HttpURLConnection) url.openConnection();
} catch (MalformedURLException e) {
throw new RuntimeException("API URL이 잘못되었습니다. : " + apiUrl, e);
} catch (IOException e) {
throw new RuntimeException("연결이 실패했습니다. : " + apiUrl, e);
}
}
private static String readBody(InputStream body) {
InputStreamReader streamReader = new InputStreamReader(body);
try (BufferedReader lineReader = new BufferedReader(streamReader)) {
StringBuilder responseBody = new StringBuilder();
String line;
while ((line = lineReader.readLine()) != null) {
responseBody.append(line);
}
return responseBody.toString();
} catch (IOException e) {
throw new RuntimeException("API 응답을 읽는 데 실패했습니다.", e);
}
}
}
import requests
import json
def send_get_request():
accessToken = "Bearer " + "<접근 토큰>"
op = "gamd"
version = "1"
tileID = "557631740"
apiURL = "https://service.mqnicrnd5.com/api/v1/am/offer/gamd?" \
+ "op=" + str(op) + "&" \
+ "version=" + str(version) + "&" \
+ "tileID=" + str(tileID)
headers = {
"Authorization": accessToken
}
response = requests.get(apiURL, headers=headers)
print("GET Request:")
print("Response Code:", response.status_code)
print("Response:", response.text)
if __name__ == "__main__":
send_get_request()
const axios = require('axios');
async function main() {
const accessToken = "Bearer <접근 토큰>";
const op = "gamd";
const version = "1";
const tileID = "557631740";
const apiURL = `https://service.mqnicrnd5.com/api/v1/am/offer/gamd?op=${op}&version=${version}&tileID=${tileID}`;
const requestHeaders = {
'Authorization': accessToken
};
try {
const responseBody = await get(apiURL, requestHeaders);
console.log(responseBody);
} catch (error) {
console.error(error);
}
}
async function get(apiUrl, requestHeaders) {
try {
const response = await axios.get(apiUrl, { headers: requestHeaders });
return response.data;
} catch (error) {
throw new Error(`API 호출 중 오류 발생: ${error.message}`);
}
}
main();
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
public class CallAPI
{
public static void Main(string[] args)
{
string accessToken = "Bearer <접근 토큰>";
string op = "gamd";
string version = "1";
string tileID = "557631740";
string apiURL = $"https://service.mqnicrnd5.com/api/v1/am/offer/gamd?" +
$"op={op}&" +
$"version={version}&" +
$"tileID={tileID}";
Dictionary<string, string> requestHeaders = new Dictionary<string, string>();
requestHeaders.Add("Authorization", accessToken);
string responseBody = Get(apiURL, requestHeaders);
Console.WriteLine(responseBody);
}
private static string Get(string apiUrl, Dictionary<string, string> requestHeaders)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiUrl);
request.Method = "GET";
foreach (var header in requestHeaders)
{
request.Headers.Add(header.Key, header.Value);
}
try
{
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
if (response.StatusCode == HttpStatusCode.OK)
{
return reader.ReadToEnd();
}
else
{
throw new Exception($"Error response from API: {response.StatusCode}");
}
}
}
catch (WebException ex)
{
throw new Exception("API request failed.", ex);
}
}
}