공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ee.Geometry.Polygon
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
다각형을 설명하는 ee.Geometry를 생성합니다.
편의를 위해 모든 인수가 숫자인 경우 varargs를 사용할 수 있습니다. 이를 통해 짝수 개의 인수가 주어지면 단일 LinearRing으로 최단 거리 EPSG:4326 다각형을 만들 수 있습니다(예: ee.Geometry.Polygon(aLng, aLat, bLng, bLat, ..., aLng, aLat)).
사용 | 반환 값 |
---|
ee.Geometry.Polygon(coords, proj, geodesic, maxError, evenOdd) | Geometry.Polygon |
인수 | 유형 | 세부정보 |
---|
coords | List<Geometry>|List<List<List<Number>>>|List<Number> | 다각형의 경계를 정의하는 링 목록입니다. GeoJSON 'Polygon' 형식의 좌표 목록, LinearRing을 설명하는 ee.Geometry 객체 목록 또는 단일 다각형 경계를 정의하는 숫자 목록일 수 있습니다. |
proj | 투영(선택사항) | 이 도형의 투영입니다. 기본값은 입력의 투영이며, 여기서 숫자는 EPSG:4326으로 간주됩니다. |
geodesic | 불리언, 선택사항 | false인 경우 모서리가 투영에서 직선입니다. true인 경우 모서리가 지구 표면에서 가장 짧은 경로를 따라 곡선으로 표시됩니다. 기본값은 입력의 측지선 상태입니다. 입력이 숫자인 경우 기본값은 true입니다. |
maxError | ErrorMargin(선택사항) | 입력 형상을 명시적으로 요청된 결과 투영 또는 최단 거리 상태로 다시 투영해야 할 때의 최대 오류입니다. |
evenOdd | 불리언, 선택사항 | true인 경우 다각형 내부는 홀수/짝수 규칙에 따라 결정됩니다. 무한대의 점에 도달하기 위해 홀수 개의 모서리를 교차하는 경우 점이 내부에 있습니다. 그렇지 않으면 다각형은 왼쪽 내부 규칙을 사용합니다. 이 규칙에 따라 지정된 순서로 꼭짓점을 따라 이동할 때 내부가 셸의 가장자리 왼쪽에 있습니다. 지정하지 않으면 기본값은 true입니다. |
예
코드 편집기 (JavaScript)
// Construct a polygon from a list of GeoJSON 'Polygon' formatted coordinates.
var polygonGeoJSON = ee.Geometry.Polygon(
[
[ // exterior ring
[100.0, 0.0],
[103.0, 0.0],
[103.0, 3.0],
[100.0, 3.0],
[100.0, 0.0] // matching the first vertex is optional
],
[ // interior ring
[101.0, 1.0],
[102.0, 2.0],
[102.0, 1.0]
]
]
);
Map.addLayer(polygonGeoJSON, {}, 'polygonGeoJSON');
// Construct a polygon from an ee.Geometry.LinearRing.
var polygonLinearRing = ee.Geometry.Polygon(
[
ee.Geometry.LinearRing(
[
[105.0, 0.0],
[108.0, 0.0],
[108.0, 3.0]
]
)
]
);
Map.addLayer(polygonLinearRing, {}, 'polygonLinearRing');
// Construct a polygon from a list of x,y coordinate pairs defining a boundary.
var polygonCoordList = ee.Geometry.Polygon(
[110.0, 0.0, 113.0, 0.0, 110.0, 3.0]
);
Map.addLayer(polygonCoordList, {}, 'polygonCoordList');
Map.centerObject(polygonLinearRing);
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003e\u003ccode\u003eee.Geometry.Polygon\u003c/code\u003e constructs a polygon geometry in Earth Engine, accepting coordinates, projection, geodesic, max error, and even/odd parameters for customization.\u003c/p\u003e\n"],["\u003cp\u003eInput coordinates can be provided as GeoJSON 'Polygon' format, a list of \u003ccode\u003eee.Geometry.LinearRing\u003c/code\u003e objects, or a list of coordinate pairs for the boundary.\u003c/p\u003e\n"],["\u003cp\u003eBy default, the projection is derived from inputs (numbers assumed as EPSG:4326), edges are straight unless \u003ccode\u003egeodesic\u003c/code\u003e is true, and interiors are determined using the even/odd rule.\u003c/p\u003e\n"],["\u003cp\u003eOptional parameters allow for specifying projection, geodesic behavior, maximum error for reprojection, and even/odd rule for polygon interiors.\u003c/p\u003e\n"],["\u003cp\u003eConveniently, polygons can be created with a single LinearRing using varargs for providing coordinate pairs in EPSG:4326.\u003c/p\u003e\n"]]],["This describes the `ee.Geometry.Polygon` constructor, which creates a polygon geometry. Key actions include defining polygon boundaries using a list of rings (in GeoJSON format, as `ee.Geometry.LinearRing` objects, or coordinate pairs). The constructor accepts optional parameters: `proj` (projection), `geodesic` (edge curvature), `maxError` (reprojection error), and `evenOdd` (interior rule). Default values are provided if the parameters are omitted, and the input arguments dictate them.\n"],null,["# ee.Geometry.Polygon\n\n\u003cbr /\u003e\n\nConstructs an ee.Geometry describing a polygon.\n\n\u003cbr /\u003e\n\nFor convenience, varargs may be used when all arguments are numbers. This allows creating geodesic EPSG:4326 Polygons with a single LinearRing given an even number of arguments, e.g. ee.Geometry.Polygon(aLng, aLat, bLng, bLat, ..., aLng, aLat).\n\n| Usage | Returns |\n|-------------------------------------------------------------------------------------|------------------|\n| `ee.Geometry.Polygon(coords, `*proj* `, `*geodesic* `, `*maxError* `, `*evenOdd*`)` | Geometry.Polygon |\n\n| Argument | Type | Details |\n|------------|------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `coords` | List\\\u003cGeometry\\\u003e\\|List\\\u003cList\\\u003cList\\\u003cNumber\\\u003e\\\u003e\\\u003e\\|List\\\u003cNumber\\\u003e | A list of rings defining the boundaries of the polygon. May be a list of coordinates in the GeoJSON 'Polygon' format, a list of ee.Geometry objects describing a LinearRing, or a list of numbers defining a single polygon boundary. |\n| `proj` | Projection, optional | The projection of this geometry. The default is the projection of the inputs, where Numbers are assumed to be EPSG:4326. |\n| `geodesic` | Boolean, optional | If false, edges are straight in the projection. If true, edges are curved to follow the shortest path on the surface of the Earth. The default is the geodesic state of the inputs, or true if the inputs are numbers. |\n| `maxError` | ErrorMargin, optional | Max error when input geometry must be reprojected to an explicitly requested result projection or geodesic state. |\n| `evenOdd` | Boolean, optional | If true, polygon interiors will be determined by the even/odd rule, where a point is inside if it crosses an odd number of edges to reach a point at infinity. Otherwise polygons use the left- inside rule, where interiors are on the left side of the shell's edges when walking the vertices in the given order. If unspecified, defaults to true. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Construct a polygon from a list of GeoJSON 'Polygon' formatted coordinates.\nvar polygonGeoJSON = ee.Geometry.Polygon(\n [\n [ // exterior ring\n [100.0, 0.0],\n [103.0, 0.0],\n [103.0, 3.0],\n [100.0, 3.0],\n [100.0, 0.0] // matching the first vertex is optional\n ],\n [ // interior ring\n [101.0, 1.0],\n [102.0, 2.0],\n [102.0, 1.0]\n ]\n ]\n);\nMap.addLayer(polygonGeoJSON, {}, 'polygonGeoJSON');\n\n// Construct a polygon from an ee.Geometry.LinearRing.\nvar polygonLinearRing = ee.Geometry.Polygon(\n [\n ee.Geometry.LinearRing(\n [\n [105.0, 0.0],\n [108.0, 0.0],\n [108.0, 3.0]\n ]\n )\n ]\n);\nMap.addLayer(polygonLinearRing, {}, 'polygonLinearRing');\n\n// Construct a polygon from a list of x,y coordinate pairs defining a boundary.\nvar polygonCoordList = ee.Geometry.Polygon(\n [110.0, 0.0, 113.0, 0.0, 110.0, 3.0]\n);\nMap.addLayer(polygonCoordList, {}, 'polygonCoordList');\n\nMap.centerObject(polygonLinearRing);\n```"]]