Earth Engine은 공유 컴퓨팅 리소스를 보호하고 모든 사용자에게 안정적인 성능을 보장하기 위해
비상업적 할당량 등급을 도입했습니다. 비상업적 프로젝트는 기본적으로 커뮤니티 등급을 사용하지만 언제든지 프로젝트의 등급을 변경할 수 있습니다.
Google은 AI 기술을 사용하여 콘텐츠를 사용자의 기본 언어로 번역합니다. AI 번역에는 오류가 있을 수 있습니다.
ee.FeatureCollection.map
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
컬렉션에 알고리즘을 매핑합니다.
매핑된 컬렉션을 반환합니다.
| 사용 | 반환 값 |
|---|
FeatureCollection.map(algorithm, dropNulls) | 컬렉션 |
| 인수 | 유형 | 세부정보 |
|---|
collection | 컬렉션 | Collection 인스턴스입니다. |
algorithm | 함수 | 컬렉션의 이미지 또는 지형지물에 매핑할 작업입니다. 이미지 또는 지형지물을 수신하고 반환하는 JavaScript 함수입니다. 함수는 한 번만 호출되고 결과는 설명으로 캡처되므로 명령형 작업을 실행하거나 외부 상태에 의존할 수 없습니다. |
dropNulls | 불리언, 선택사항 | true인 경우 매핑된 알고리즘은 null을 반환할 수 있으며 null을 반환하는 요소는 삭제됩니다. |
예
코드 편집기(JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// Function to convert power plant capacity from megawatts to gigawatts and
// add the value as a new feature property.
var mwToGw = function(feature) {
var megawatt = feature.getNumber('capacitymw');
var gigawatt = megawatt.divide(1000);
return feature.set('capacitygw', gigawatt);
};
// Apply the function to each feature in the collection.
fc = fc.map(mwToGw);
print('Note the new "capacitygw" property in each feature', fc);
Python 설정
Python API 및 대화형 개발을 위한 geemap 사용에 대한 자세한 내용은
Python 환경 페이지를 참조하세요.
import ee
import geemap.core as geemap
Colab(Python)
# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"')
# Function to convert power plant capacity from megawatts to gigawatts and
# add the value as a new feature property.
def mw_to_gw(feature):
megawatt = feature.getNumber('capacitymw')
gigawatt = megawatt.divide(1000)
return feature.set('capacitygw', gigawatt)
# Apply the function to each feature in the collection.
fc = fc.map(mw_to_gw)
display('Note the new "capacitygw" property in each feature:', fc)
[null,null,["최종 업데이트: 2026-11-05(UTC)"],[],["The `map` algorithm applies a user-defined function to each element within a collection (e.g., features or images). This function, which accepts an element as input and returns a modified one, is applied to each item of the collection. The `dropNulls` argument allows filtering null return values. The result is a new collection containing the modified elements. For example, converting power plant capacity units and adding them as a new property to the features.\n"]]