ee.FeatureCollection.union

지정된 컬렉션의 모든 도형을 하나로 병합하고 'union_result' ID와 도형만 있는 단일 지형지물이 포함된 컬렉션을 반환합니다.

사용반환 값
FeatureCollection.union(maxError)FeatureCollection
인수유형세부정보
다음과 같은 경우: collectionFeatureCollection병합할 컬렉션입니다.
maxErrorErrorMargin, 기본값: null필요한 재투영을 실행할 때 허용되는 최대 오류입니다. 지정하지 않으면 출력에서 요청된 오류 마진이 기본값입니다.

코드 편집기 (JavaScript)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
            .filter('country_lg == "Belgium"');

print('Original FeatureCollection', fc);

// Merge all geometries into one. A FeatureCollection with a single feature
// with no properties is returned.
print('All geometries merged into one', fc.union(1));

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"')

print('Original FeatureCollection:', fc.getInfo())

# Merge all geometries into one. A FeatureCollection with a single feature
# with no properties is returned.
print('All geometries merged into one:', fc.union(1).getInfo())