자율차전용지도 (제공)
자율차 전용지도를 제공합니다.
ASN.1 파일 다운로드
자율차 전용지도는 ISO 22726-1 표준 포맷으로 인코딩되어 있습니다. 데이터 구조 확인 및 디코딩을 위해선 아래 ASN.1 파일을 다운로드 받아 활용해주시기 바랍니다.
1️. Tile ID 조회 (GetTileID)
요청 URL
https://service.mqnicrnd5.com/api/v1/am/offer/gti
연계 주기
요청 시
프로토콜
HTTPS
HTTP 메서드
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"
}
]
}
2. Map 버전 확인 API (GetAutonomousMapVersion)
요청 URL
https://service.mqnicrnd5.com/api/v1/am/offer/gamv
연계 주기
요청 시
프로토콜
HTTPS
HTTP 메서드
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
}
}
3. 자율차전용지도 데이터 제공 API (GetAutonomousMapData)
요청 URL
https://service.mqnicrnd5.com/api/v1/am/offer/gamd
연계 주기
요청 시
프로토콜
HTTPS
HTTP 메서드
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..."
}
}
4. 자율차 전용지도 제공 API 구현 예제
다음은 각 언어별 자율차 전용지도 제공 API 구현 예제입니다.
Tile ID 조회 (GetTileID)
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);
}
}
}
Map 버전 확인 API (GetAutonomousMapVersion)
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);
}
}
}
자율차전용지도 데이터 제공 API (GetAutonomousMapData)
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);
}
}
}
Last updated