전 세계에서 고유하게 한 지점을 참조하는 위도 및 경도 값. (Google은
세계 측지
시스템 WGS84 표준을 사용)
지도의 한 지점을 고유하게 참조하는 세계 좌표
특정 확대/축소 수준에서 지도의 특정 픽셀을 참조하는 픽셀 좌표
특정 확대/축소 수준에서 지도의 특정 타일을 참조하는 타일 좌표
세계 좌표
API는 세계의 한 위치를 지도상의 위치로 변환해야 할 때마다
먼저 위도와 경도 값을
세계 좌표로 변환합니다. 변환에는
메르카토르
투영법이 사용됩니다.
픽셀 좌표를 계산하기 쉽도록(아래 참조),
확대/축소 수준이 0인 지도를 기본 타일 크기의 단일 타일이라고 가정합니다.
그런 다음 확대/축소 수준 0의 픽셀 좌표에 대한 세계 좌표를 정의하고,
메르카토르 투영법을 사용하여 위도 및 경도를
이 기본 타일의 픽셀 위치로 변환합니다. 해당 세계 좌표는 지도 투영의 원점에서
특정 위치까지 측정한
부동 소수점 값입니다. 이 값은 부동 소수점이므로,
현재 표시되는 지도 이미지의 해상도보다
훨씬 더 정확할 수 있습니다. 즉, 세계 좌표는 현재 확대/축소 수준과
무관합니다.
Google 지도에서 세계 좌표는 메르카토르
투영의 원점(경도 180도와 위도 약 85도에 있는
지도의 북서쪽 모서리)에서 측정되어
동쪽(오른쪽)을 향해 x 방향으로 증가하고
남쪽(아래쪽)을 향해 y 방향으로 증가합니다. 기본적인
메르카토르 Google 지도 타일은 256x256픽셀이므로
사용 가능한 세계 좌표 공간은 {0-256}, {0-256}입니다.
참고로 메르카토르 투영법은 경도로는 너비가
한정되어 있지만 위도로는 높이에 제한이 없습니다. Google에서는 메르카토르
투영법을 활용하여 약 +/-85도로 기본 지도 이미지를 잘라
결과로 표시되는 지도 모양을 정사각형으로 만듭니다.
이런 방식으로 타일 선택에 더 쉬운 로직을 적용하게 됩니다. 예를 들어 극점에서 매우 가까운 곳에 좌표를 그리면,
기본 지도의 사용 가능한 좌표 공간 바깥에
세계 좌표가 생성될 수 있습니다.
픽셀 좌표
픽셀 좌표는 특정 확대/축소 수준에서 지도의
특정 픽셀을 참조하는 반면, 세계 좌표는
지정된 투영에서의 절대 위치를 나타냅니다. 픽셀 좌표는 다음 공식으로
계산됩니다.
pixelCoordinate = worldCoordinate * 2zoomLevel
위 방정식에서 확대/축소 수준이 증가할 때마다
x 및 y 방향으로
두 배씩 커집니다. 그러므로 확대/축소 수준이 한 단계 높아지면
이전 수준보다 해상도가 4배 증가합니다. 예를 들어 확대/축소 수준이 1이면
지도는 256x256 픽셀 타일 4개,
즉 512x512의 픽셀 공간으로 구성됩니다. 확대/축소 수준 19에서 지도의 x 및 y 픽셀은
각각 0~256 * 219 값으로
참조될 수 있습니다.
세계 좌표는 지도의 타일 크기에 기반하므로,
픽셀 좌표의 정수 부분을 보면 현재 확대/축소 수준에서
해당 장소의 정확한 픽셀을 알아낼 수 있습니다. 확대/축소 수준이 0일 경우
픽셀 좌표는 세계 좌표와 같습니다.
이제 각 확대/축소 수준에서 지도에 위치를 정확히 나타내는 방법을
알게 되었습니다. Android용 Maps SDK는 지도의 확대/축소 수준 중심(LatLng 값)과
포함된 DOM 요소의 크기를 고려하여
표시 영역을 생성하고 이 경계 상자를
픽셀 좌표로 변환합니다. 그런 다음 API가 특정 픽셀 경계 내에 있는
모든 지도 타일을 논리적으로 판별합니다. 이러한
각 지도 타일은 지도 이미지의 표시를
매우 단순화하는 타일 좌표를
사용하여 참조됩니다.
타일 좌표
높은 확대/축소 수준에서는 API가 모든 지도 이미지를 한 번에 로드할 수 없습니다.
대신 각 확대/축소 수준의
이미지를 지도 타일 집합으로 분할합니다.
이 타일 집합은 애플리케이션이 이해하는 순서대로 논리적으로 정렬됩니다. 지도에서 새 위치나 새 확대/축소 수준으로 스크롤하면
API가 픽셀 좌표를 사용하여
어느 타일이 필요한지 알아내고
해당 값을 검색할 타일 집합으로 변환합니다. 이 타일 좌표는 스키마를 사용하여 할당되므로
주어진 지점에서 어느 타일이 이미지를 포함하는지
논리적으로 판별하기 쉬워집니다.
Google 지도의 타일은 픽셀과 동일한 원점에서부터
번호가 매겨집니다. Google에서 구현한 메르카토르 투영법의 경우
원점 타일은 항상 지도의 북서쪽 모서리에 있으며,
x 값은 서쪽에서 동쪽으로 갈수록 증가하고
y 값은 북쪽에서 남쪽으로 갈수록 증가합니다. 타일의 색인은
해당 원점에서부터 x,y 좌표를 사용하여 생성됩니다. 예를 들어
확대/축소 수준 2에서 지구가 16개의 타일로 나뉘면
각 타일은 다음과 같이 고유한 x,y 쌍으로 참조될 수 있습니다.
픽셀 좌표를 타일 크기(256)로 나누고
그 결과값에서 정수 부분을 가져오면
현재 확대/축소 수준의 타일 좌표를 추가로 얻을 수 있습니다.
예
다음 예에는 일리노이주 시카고의
좌표(위도/경도 값, 세계 좌표, 픽셀 좌표, 타일 좌표)가
표시되어 있습니다. 확대/축소 컨트롤을 사용하여
다양한 확대/축소 수준의 좌표 값을 확인하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-06-28(UTC)"],[[["\u003cp\u003eThe Maps SDK for Android uses four coordinate systems: latitude/longitude, world, pixel, and tile coordinates.\u003c/p\u003e\n"],["\u003cp\u003eWorld coordinates are based on the Mercator projection and represent locations independent of zoom level.\u003c/p\u003e\n"],["\u003cp\u003ePixel coordinates denote a specific pixel on the map at a given zoom level, calculated using world coordinates and zoom level.\u003c/p\u003e\n"],["\u003cp\u003eTile coordinates simplify map imagery display by dividing the map into a grid of tiles, referenced by x,y coordinates.\u003c/p\u003e\n"],["\u003cp\u003eTile coordinates are derived from pixel coordinates and zoom level, facilitating efficient loading of map imagery.\u003c/p\u003e\n"]]],["The Maps SDK uses four coordinate systems: latitude/longitude (WGS84 standard), world, pixel, and tile. World coordinates, derived via Mercator projection, represent locations on the map relative to a base tile at zoom level 0. Pixel coordinates, calculated as `worldCoordinate * 2^zoomLevel`, specify pixels at specific zoom levels. Tile coordinates, determined by dividing pixel coordinates by tile size (256), reference specific map tiles for loading imagery. Each coordinate type is essential for rendering and managing map data.\n"],null,["# Map and Tile Coordinates\n\nSelect platform: [Android](/maps/documentation/android-sdk/coordinates \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/coordinates \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/coordinates \"View this page for the JavaScript platform docs.\")\n\nThe Maps SDK for Android uses the following coordinate systems:\n\n- Latitude and longitude values, which reference a point on the world uniquely. (Google uses the [World Geodetic\n System WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System) standard.)\n- World coordinates, which reference a point on the map uniquely.\n- Pixel coordinates, which reference a specific pixel on the map at a specific zoom level.\n- Tile coordinates, which reference a specific tile on the map at a specific zoom level.\n\nWorld coordinates\n-----------------\n\nWhenever the API needs to translate a location in the world to a location on\na map, it first translates latitude and longitude values into a\n*world* coordinate. The API uses the\n[Mercator\nprojection](https://en.wikipedia.org/wiki/Mercator_projection) to perform this translation.\n\nFor convenience in the calculation of pixel coordinates (see below)\nwe assume a map at zoom level 0 is a single tile of the base tile size.\nWe then define world coordinates relative to pixel coordinates at zoom\nlevel 0, using the projection to convert latitudes and longitudes to\npixel positions on this base tile. This world coordinate is a floating\npoint value measured from the origin of the map projection to the\nspecific location. Note that since this value is a floating point value,\nit may be much more precise than the current resolution of the map image\nbeing shown. A world coordinate is independent of the current zoom level,\nin other words.\n\nWorld coordinates in Google Maps are measured from the Mercator\nprojection's origin (the northwest corner of the map at 180 degrees\nlongitude and approximately 85 degrees latitude) and increase in\nthe `x` direction towards the east (right) and increase in\nthe `y` direction towards the south (down). Because the\nbasic Mercator Google Maps tile is 256 x 256 pixels, the usable\nworld coordinate space is `{0-256}, {0-256}`.\n\nNote that a Mercator projection has a finite\nwidth longitudinally but an infinite height latitudinally. We cut off\nbase map imagery utilizing the Mercator projection at approximately\n+/- 85 degrees to make the resulting map shape square, which allows\neasier logic for tile selection. Note that a projection may produce\nworld coordinates outside the base map's usable coordinate space\nif you plot very near the poles, for example.\n\nPixel coordinates\n-----------------\n\n*Pixel coordinates* reference a specific pixel on the map at a\nspecific zoom level, whereas world coordinates reflect absolute locations on a\ngiven projection. Pixel coordinates are calculated using the following\nformula: \n\n```scdoc\npixelCoordinate = worldCoordinate * 2zoomLevel\n```\n\nFrom the above equation, note that each increasing zoom level\nis twice as large in both the `x` and `y`\ndirections. Therefore, each higher zoom level results in a resolution four\ntimes higher than the preceding level. For example, at zoom level 1,\nthe map consists of 4 256x256 pixels tiles, resulting in a pixel space\nfrom 512x512. At zoom level 19, each `x` and `y` pixel\non the map can be referenced using a value between\n0 and 256 \\* 2^19^.\n\nBecause we based world coordinates on the map's tile size, a\npixel coordinate's integer part has the effect of identifying the exact pixel\nat that location in the current zoom level. Note that for zoom level 0, the\npixel coordinates are equal to the world coordinates.\n\nWe now have a way to accurately denote each location on the map,\nat each zoom level. The Maps SDK for Android constructs a viewport\ngiven the zoom level center of the map (as a `LatLng`) and the\nsize of the containing DOM element, and\ntranslates this bounding box into pixel coordinates. The API then determines\nlogically all map tiles which lie within the given pixel bounds. Each of\nthese map tiles are referenced using [tile coordinates](#tile-coordinates) which greatly simplify the displaying of map\nimagery.\n\nTile coordinates\n----------------\n\nThe API cannot load all the map imagery at once for the higher zoom levels.\nInstead, the API breaks up the imagery at each zoom level\ninto a set of map tiles, which are logically arranged in an order which the\napplication understands. When a map scrolls to a new location, or to a new\nzoom level, the API determines which tiles are needed\nusing pixel coordinates, and translates those values into a set\nof tiles to retrieve. These tile coordinates are assigned using\na scheme which makes it logically easy to determine which tile contains\nthe imagery for any given point.\n\nTiles in Google Maps are numbered from the same origin as that\nfor pixels. For Google's implementation of the Mercator projection, the\norigin tile is always at the northwest corner\nof the map, with `x` values increasing from west to\neast and `y` values increasing from north to south. Tiles\nare indexed using `x,y` coordinates from that origin. For\nexample, at zoom level 2, when the earth is divided up into 16 tiles,\neach tile can be referenced by a unique `x,y` pair:\n\nNote that by dividing the pixel coordinates by the tile size (256) and\ntaking the integer parts of the result, you produce as a by-product\nthe tile coordinate at the current zoom level.\n\nExample\n-------\n\nThe following example displays coordinates for Chicago, IL:\nlatitude/longitude values, world coordinates, pixel coordinates, and tile\ncoordinates. Use the zoom control to see the coordinate values at various\nzoom levels.\n\nTo see how the coordinates were calculated,\n[view\nthe code](/maps/documentation/javascript/examples/map-coordinates)."]]