공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ee.FeatureCollection.makeArray
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
각 기능의 속성 목록을 1차원 배열로 결합하여 컬렉션의 각 기능에 1차원 배열을 추가합니다. 모든 속성은 숫자 값이어야 합니다. 특성에 명명된 속성이 모두 포함되지 않거나 속성 중 하나가 숫자가 아닌 경우 특성이 결과 컬렉션에서 삭제됩니다.
사용 | 반환 값 |
---|
FeatureCollection.makeArray(properties, name) | FeatureCollection |
인수 | 유형 | 세부정보 |
---|
다음과 같은 경우: collection | FeatureCollection | 속성이 선택될 입력 컬렉션입니다. |
properties | 목록 | 선택할 속성입니다. |
name | 문자열, 기본값: 'array' | 새 배열 속성의 이름입니다. |
예
코드 편집기 (JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// A list of feature properties to combine into an array
// (power generation by year).
var properties = ['gwh_2013', 'gwh_2014', 'gwh_2015', 'gwh_2016'];
// Add array of power-generation-by-year property to features.
fc = fc.makeArray(properties, 'gwh_by_year');
print('FeatureCollection with array of selected properties added', fc);
print('See example of new "gwh_by_year" property', fc.first().toDictionary());
Python 설정
Python API 및 geemap
를 사용한 대화형 개발에 관한 자세한 내용은
Python 환경 페이지를 참고하세요.
import ee
import geemap.core as geemap
Colab (Python)
from pprint import pprint
# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"')
# A list of feature properties to combine into an array
# (power generation by year).
properties = ['gwh_2013', 'gwh_2014', 'gwh_2015', 'gwh_2016']
# Add array of power-generation-by-year property to features.
fc = fc.makeArray(properties, 'gwh_by_year')
print('FeatureCollection with array of selected properties added:',
fc.getInfo())
print('See example of new "gwh_by_year" property:')
pprint(fc.first().toDictionary().getInfo())
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003e\u003ccode\u003emakeArray()\u003c/code\u003e combines specified numeric properties of features within a FeatureCollection into a new 1-D array property.\u003c/p\u003e\n"],["\u003cp\u003eFeatures lacking any of the specified properties, or containing non-numeric values in those properties, are excluded from the output.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting FeatureCollection contains the original features with an added array property holding the combined values.\u003c/p\u003e\n"],["\u003cp\u003eThe array property is named using the 'name' argument, defaulting to "array" if not provided.\u003c/p\u003e\n"]]],[],null,["# ee.FeatureCollection.makeArray\n\nAdd a 1-D Array to each feature in a collection by combining a list of properties for each feature into a 1-D Array. All of the properties must be numeric values. If a feature doesn't contain all of the named properties, or any of them aren't numeric, the feature will be dropped from the resulting collection.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------|-------------------|\n| FeatureCollection.makeArray`(properties, `*name*`)` | FeatureCollection |\n\n| Argument | Type | Details |\n|--------------------|--------------------------|--------------------------------------------------------------|\n| this: `collection` | FeatureCollection | The input collection from which properties will be selected. |\n| `properties` | List | The properties to select. |\n| `name` | String, default: \"array\" | The name of the new array property. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// FeatureCollection of power plants in Belgium.\nvar fc = ee.FeatureCollection('WRI/GPPD/power_plants')\n .filter('country_lg == \"Belgium\"');\n\n// A list of feature properties to combine into an array\n// (power generation by year).\nvar properties = ['gwh_2013', 'gwh_2014', 'gwh_2015', 'gwh_2016'];\n\n// Add array of power-generation-by-year property to features.\nfc = fc.makeArray(properties, 'gwh_by_year');\n\nprint('FeatureCollection with array of selected properties added', fc);\nprint('See example of new \"gwh_by_year\" property', fc.first().toDictionary());\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\nfrom pprint import pprint\n\n# FeatureCollection of power plants in Belgium.\nfc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(\n 'country_lg == \"Belgium\"')\n\n# A list of feature properties to combine into an array\n# (power generation by year).\nproperties = ['gwh_2013', 'gwh_2014', 'gwh_2015', 'gwh_2016']\n\n# Add array of power-generation-by-year property to features.\nfc = fc.makeArray(properties, 'gwh_by_year')\n\nprint('FeatureCollection with array of selected properties added:',\n fc.getInfo())\nprint('See example of new \"gwh_by_year\" property:')\npprint(fc.first().toDictionary().getInfo())\n```"]]