도형 사이 최단 거리
| 항목 | 값 |
|---|---|
| 화면 이름 | Geometry shortest distance |
| 식별자 | geometryShortestDistanceV1 |
| 지원 실행 방식 | Batch, Streaming |
| 범주 | 지리공간 (Geospatial) |
| 반환 자료형 | Double |
유효한 두 도형 사이의 최단 대권 거리를 미터로 계산합니다. 지구를 구로 근사하며 도형이 겹치면 거리는 0입니다.
입력 인자
| 이름 | 지정 여부 | 자료형 | 의미와 조건 |
|---|---|---|---|
Geometry a | 필수 | Expression<Geometry> | 도형 a입니다. |
Geometry b | 필수 | Expression<Geometry> | 도형 b입니다. |
입출력 예시
예시 1: 기본 동작
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| {"type":"LineString","coordinates":[[-40, 0],[-30, 0]]}} | {"type":"Polygon","coordinates":[[[-30,-30],[-30, 30],[30, 30],[30, -30],[-30, -30]]]} | 0.0 |
| {"type":"Point","coordinates":[0,0]}} | {"type":"Polygon","coordinates":[[[-30,-30],[-30, 30],[30, 30],[30, -30],[-30, -30]]]} | 0.0 |
| {"type":"Point","coordinates":[-30,29]}} | {"type":"Polygon","coordinates":[[[-30,-30],[-30, 30],[30, 30],[30, -30],[-30, -30]]]} | 0.0 |
| {"type":"Polygon","coordinates":[[[40,0],[-40,0],[0,40],[40,0]]]} | {"type":"Polygon","coordinates":[[[-30,-30],[-30, 30],[30, 30],[30,-30],[-30,-30]]]} | 0.0 |
| {"type":"Polygon","coordinates":[[[-40,0],[40,0],[0,40],[-40,0]]]} | {"type":"Polygon","coordinates":[[[-30,-30],[-30,0],[30,0],[30,-30],[-30,-30]]]} | 0.0 |
예시 2: 기본 동작
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| {"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[87.0,77.0]},{"type":"LineString","coordinates":[[80.0,0],[90.0,0]]}]} | {"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[70.0,-100.0]},{"type":"Lin... | 39438.65354637 |
| {"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[170,90]},{"type":"LineStri... | {"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[-87,-73]},{"type":"LineStr... | 5310295.471462 |
| {"type":"GeometryCollection","geometries":[{"type":"MultiPoint","coordinates":[[170,90],[171,91]]},{... | {"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[-87,-73]},{"type":"LineStr... | 5327143.5044855 |
예시 3: 기본 동작
점과 GeometryCollection 사이의 최단 거리가 다각형 변의 중간 지점에 놓이는 경우입니다.
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| {"type":"Point","coordinates":[1,24]} | {"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[70.0,-100.0]},{"type":"Lin... | 3285803.956493 |
| {"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[70.0,-100.0]},{"type":"Lin... | {"type":"Point","coordinates":[1.0,-14.0]} | 1227726.9895314 |
예시 4: 기본 동작
점에서 선 문자열의 끝점이 아닌 내부 지점으로 향하는 대권 경로가 최단 경로인 경우입니다.
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| {"type":"Point","coordinates":[1,23]} | {"type":"LineString","coordinates":[[51.93,95.6],[-43.7,22.2]]}} | 4557966.282534 |
예시 5: 기본 동작
점에서 선 문자열의 첫 끝점으로 향하는 경로가 최단 경로인 경우입니다.
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| {"type":"Point","coordinates":[171,23]} | {"type":"LineString","coordinates":[[-174,21],[-43.7,22.2]]} | 1561650.083282 |
예시 6: 기본 동작
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| {"type":"Point","coordinates":[12.3,45.6]} | {"type":"Point","coordinates":[3,3.5]} | 4767896.596327 |
| {"type":"Point","coordinates":[-172.45613,-80]} | {"type":"Point","coordinates":[7.54387,-80]} | 2223902.02355 |
예시 7: 기본 동작
점에서 다각형의 꼭짓점이 아닌 변 내부 지점으로 향하는 대권 경로가 최단 경로인 경우입니다.
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| {"type":"Point","coordinates":[1,23]} | {"type":"Polygon","coordinates":[[[33.969414,27.763400],[20.325411,69.748301],[37.607794,71.926251],[47.741855,42.169452],[33.969414,27.763400]]]} | 3328300.4609136 |
| {"type":"Point","coordinates":[36.06123680798,52.664515483941]} | {"type":"Polygon","coordinates":[[[33.969414,27.7634],[47.741855,42.169452],[37.607794,71.926251],[2... | 67765.90969341 |
예시 8: 기본 동작
점에서 다각형 꼭짓점으로 향하는 경로가 최단 경로인 경우입니다.
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| {"type":"Point","coordinates":[1,23]} | {"type":"Polygon","coordinates":[[[-31.224246,67.357277],[-4.635177,38.608765],[-12.085376,85.774983],[-31.224246,67.357277]]]} | 1816109.959427 |
예시 9: null 처리
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| hello, world! | {"type":"Point","coordinates":[0.0,0.0]} | null |
예시 10: null 처리
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| null | {"type":"Point","coordinates":[]} | null |
| {} | {"type":"Point","coordinates":[]} | null |
| null | null | null |
예시 11: 경계 조건
인자 값:
Geometry a:geometry_aGeometry b:geometry_b
| geometry_a | geometry_b | 출력 |
|---|---|---|
| {"type":"Point","coordinates":[19.409686726843,-10.140156318979]} | {"type":"Point","coordinates":[-160.590313273157, 10.140156318979]} | 2.0015118211947E7 |
| {"type":"Point","coordinates":[69,-90]} | {"type":"Point","coordinates":[0,90]} | 2.0015118211947E7 |
긴 구조값 안의 줄임표는 생략한 내용을 나타냅니다.