공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ee.Geometry
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
기하 도형을 만듭니다.
사용 | 반환 값 |
---|
ee.Geometry(geoJson, proj, geodesic, evenOdd) | 도형 |
인수 | 유형 | 세부정보 |
---|
geoJson | 객체 | 도형을 설명하는 GeoJSON 객체 또는 도형으로 재해석될 ComputedObject입니다. GeoJSON 사양에 따라 CRS 사양을 지원하지만 명명된 CRS만 허용합니다('연결된' CRS는 허용되지 않음). 여기에 'geodesic' 필드가 포함되어 있고 opt_geodesic이 지정되지 않은 경우 opt_geodesic으로 사용됩니다. |
proj | 투영(선택사항) | 선택적 투영 사양(CRS ID 코드 또는 WKT 문자열)입니다. 지정된 경우 geoJson 매개변수에서 발견된 CRS를 재정의합니다. 지정되지 않았고 geoJson이 CRS를 선언하지 않으면 기본값은 'EPSG:4326' (x=경도, y=위도)입니다. |
geodesic | 불리언, 선택사항 | 선 세그먼트를 구면 측지선으로 해석할지 여부입니다. false인 경우 선분이 지정된 CRS의 평면 선으로 해석되어야 함을 나타냅니다. 없는 경우 CRS가 지리적 (기본 EPSG:4326 포함)이면 true로, CRS가 투영되면 false로 기본 설정됩니다. |
evenOdd | 불리언, 선택사항 | true인 경우 다각형 내부는 짝수/홀수 규칙에 따라 결정됩니다. 무한대의 점에 도달하기 위해 홀수 개의 모서리를 교차하는 경우 점이 내부에 있습니다. 그렇지 않으면 다각형은 왼쪽 내부 규칙을 사용합니다. 이 규칙에 따라 지정된 순서로 꼭짓점을 따라 이동할 때 내부가 셸의 가장자리 왼쪽에 있습니다. 지정하지 않으면 기본값은 true입니다. |
예
코드 편집기 (JavaScript)
// A GeoJSON object for a triangular polygon.
var geojsonObject = {
"type": "Polygon",
"coordinates": [
[
[
-122.085,
37.423
],
[
-122.092,
37.424
],
[
-122.085,
37.418
],
[
-122.085,
37.423
]
]
]
};
print('ee.Geometry accepts a GeoJSON object', ee.Geometry(geojsonObject));
// GeoJSON strings need to be converted to an object.
var geojsonString = JSON.stringify(geojsonObject);
print('A GeoJSON string needs to be converted to an object',
ee.Geometry(JSON.parse(geojsonString)));
// Use ee.Geometry to cast computed geometry objects into the ee.Geometry
// class to access their methods. In the following example an ee.Geometry
// object is stored as a ee.Feature property. When it is retrieved with the
// .get() function, a computed geometry object is returned. Cast the computed
// object as a ee.Geometry to get the geometry's bounds, for instance.
var feature = ee.Feature(null, {geom: ee.Geometry(geojsonObject)});
print('Cast computed geometry objects to ee.Geometry class',
ee.Geometry(feature.get('geom')).bounds());
Python 설정
Python API 및 geemap
를 사용한 대화형 개발에 관한 자세한 내용은
Python 환경 페이지를 참고하세요.
import ee
import geemap.core as geemap
Colab (Python)
import json
# A GeoJSON object for a triangular polygon.
geojson_object = {
'type': 'Polygon',
'coordinates': [
[
[
-122.085,
37.423
],
[
-122.092,
37.424
],
[
-122.085,
37.418
],
[
-122.085,
37.423
]
]
]
}
print(
'ee.Geometry accepts a GeoJSON object:',
ee.Geometry(geojson_object).getInfo()
)
# GeoJSON strings need to be converted to an object.
geojson_string = json.dumps(geojson_object)
print('A GeoJSON string needs to be converted to an object:',
ee.Geometry(json.loads(geojson_string)).getInfo())
# Use ee.Geometry to cast computed geometry objects into the ee.Geometry
# class to access their methods. In the following example an ee.Geometry
# object is stored as a ee.Feature property. When it is retrieved with the
# .get() function, a computed geometry object is returned. Cast the computed
# object as a ee.Geometry to get the geometry's bounds, for instance.
feature = ee.Feature(None, {'geom': ee.Geometry(geojson_object)})
print('Cast computed geometry objects to ee.Geometry class:',
ee.Geometry(feature.get('geom')).bounds().getInfo())
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eCreates a geometry from a GeoJSON object, optionally specifying projection, geodesic handling, and polygon winding rule.\u003c/p\u003e\n"],["\u003cp\u003eAccepts GeoJSON objects or strings (which must be parsed into objects).\u003c/p\u003e\n"],["\u003cp\u003eEnables casting of computed geometry objects (like those in Feature properties) to the \u003ccode\u003eee.Geometry\u003c/code\u003e class for method access.\u003c/p\u003e\n"],["\u003cp\u003eSupports both JavaScript and Python environments within Google Earth Engine.\u003c/p\u003e\n"]]],[],null,["# ee.Geometry\n\n\u003cbr /\u003e\n\nCreates a geometry.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------------------|----------|\n| `ee.Geometry(geoJson, `*proj* `, `*geodesic* `, `*evenOdd*`)` | Geometry |\n\n| Argument | Type | Details |\n|------------|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `geoJson` | Object | The GeoJSON object describing the geometry or a ComputedObject to be reinterpreted as a Geometry. Supports CRS specifications as per the GeoJSON spec, but only allows named (rather than \"linked\" CRSs). If this includes a 'geodesic' field, and opt_geodesic is not specified, it will be used as opt_geodesic. |\n| `proj` | Projection, optional | An optional projection specification, either as a CRS ID code or as a WKT string. If specified, overrides any CRS found in the geoJson parameter. If unspecified and the geoJson does not declare a CRS, defaults to \"EPSG:4326\" (x=longitude, y=latitude). |\n| `geodesic` | Boolean, optional | Whether line segments should be interpreted as spherical geodesics. If false, indicates that line segments should be interpreted as planar lines in the specified CRS. If absent, defaults to true if the CRS is geographic (including the default EPSG:4326), or to false if the CRS is projected. |\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// A GeoJSON object for a triangular polygon.\nvar geojsonObject = {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n -122.085,\n 37.423\n ],\n [\n -122.092,\n 37.424\n ],\n [\n -122.085,\n 37.418\n ],\n [\n -122.085,\n 37.423\n ]\n ]\n ]\n};\nprint('ee.Geometry accepts a GeoJSON object', ee.Geometry(geojsonObject));\n\n// GeoJSON strings need to be converted to an object.\nvar geojsonString = JSON.stringify(geojsonObject);\nprint('A GeoJSON string needs to be converted to an object',\n ee.Geometry(JSON.parse(geojsonString)));\n\n// Use ee.Geometry to cast computed geometry objects into the ee.Geometry\n// class to access their methods. In the following example an ee.Geometry\n// object is stored as a ee.Feature property. When it is retrieved with the\n// .get() function, a computed geometry object is returned. Cast the computed\n// object as a ee.Geometry to get the geometry's bounds, for instance.\nvar feature = ee.Feature(null, {geom: ee.Geometry(geojsonObject)});\nprint('Cast computed geometry objects to ee.Geometry class',\n ee.Geometry(feature.get('geom')).bounds());\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nimport json\n\n# A GeoJSON object for a triangular polygon.\ngeojson_object = {\n 'type': 'Polygon',\n 'coordinates': [\n [\n [\n -122.085,\n 37.423\n ],\n [\n -122.092,\n 37.424\n ],\n [\n -122.085,\n 37.418\n ],\n [\n -122.085,\n 37.423\n ]\n ]\n ]\n}\nprint(\n 'ee.Geometry accepts a GeoJSON object:',\n ee.Geometry(geojson_object).getInfo()\n)\n\n# GeoJSON strings need to be converted to an object.\ngeojson_string = json.dumps(geojson_object)\nprint('A GeoJSON string needs to be converted to an object:',\n ee.Geometry(json.loads(geojson_string)).getInfo())\n\n# Use ee.Geometry to cast computed geometry objects into the ee.Geometry\n# class to access their methods. In the following example an ee.Geometry\n# object is stored as a ee.Feature property. When it is retrieved with the\n# .get() function, a computed geometry object is returned. Cast the computed\n# object as a ee.Geometry to get the geometry's bounds, for instance.\nfeature = ee.Feature(None, {'geom': ee.Geometry(geojson_object)})\nprint('Cast computed geometry objects to ee.Geometry class:',\n ee.Geometry(feature.get('geom')).bounds().getInfo())\n```"]]