ee.FeatureCollection.makeArray

각 기능의 속성 목록을 1차원 배열로 결합하여 컬렉션의 각 기능에 1차원 배열을 추가합니다. 모든 속성은 숫자 값이어야 합니다. 특성에 명명된 속성이 모두 포함되지 않거나 속성 중 하나가 숫자가 아닌 경우 특성이 결과 컬렉션에서 삭제됩니다.

사용반환 값
FeatureCollection.makeArray(properties, name)FeatureCollection
인수유형세부정보
다음과 같은 경우: collectionFeatureCollection속성이 선택될 입력 컬렉션입니다.
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())