ee.FeatureCollection.set

요소의 메타데이터 속성을 하나 이상 재정의합니다.

지정된 속성이 재정의된 요소를 반환합니다.

사용반환 값
FeatureCollection.set(var_args)요소
인수유형세부정보
다음과 같은 경우: element요소Element 인스턴스입니다.
var_argsVarArgs<Object>속성 사전 또는 속성의 vararg 시퀀스입니다(예: key1, value1, key2, value2, ...).

코드 편집기 (JavaScript)

// An empty FeatureCollection for simple demonstration.
var fc = ee.FeatureCollection([]);

// Set a single new property using a key-value pair.
fc = fc.set('key_1', 'value 1');

// Set multiple new properties using a series of key-value pairs.
fc = fc.set('key_2', 'value 2',
            'key_3', 3);

// Set new properties using a dictionary of key-value pairs.
fc = fc.set({
  key_5: ee.Array([1, 2, 3]),
  key_6: ee.Image(0),
  key_7: ee.Feature(null)
});
print('New FeatureCollection properties added', fc);

// Overwrite an existing property.
fc = fc.set('key_1', 'overwritten');
print('FeatureCollection property overwritten', fc);

Python 설정

Python API 및 geemap를 사용한 대화형 개발에 관한 자세한 내용은 Python 환경 페이지를 참고하세요.

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

# An empty FeatureCollection for simple demonstration.
fc = ee.FeatureCollection([])

# Set a single new property using a key-value pair.
fc = fc.set('key_1', 'value 1')

# Set multiple new properties using a series of key-value pairs.
fc = fc.set('key_2', 'value 2', 'key_3', 3)

# Set new properties using a dictionary of key-value pairs.
fc = fc.set({
  'key_5': ee.Array([1, 2, 3]),
  'key_6': ee.Image(0),
  'key_7': ee.Feature(None)
})
print('New FeatureCollection properties added:')
pprint(fc.getInfo())

# Overwrite an existing property.
fc = fc.set('key_1', 'overwritten')
print('FeatureCollection property overwritten:')
pprint(fc.getInfo())