ee.FeatureCollection.distinct

컬렉션에서 중복 항목을 삭제합니다. 중복은 선택한 속성의 직렬화된 형태에 대한 강력한 해시를 사용하여 결정됩니다.

사용반환 값
FeatureCollection.distinct(properties)FeatureCollection
인수유형세부정보
다음과 같은 경우: collectionFeatureCollection객체를 선택할 입력 컬렉션입니다.
properties객체비교에 사용할 속성 이름 또는 속성 이름 목록입니다. '.geo' 속성을 포함하여 객체 지오메트리를 비교할 수 있습니다.

코드 편집기 (JavaScript)

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

// Remove duplicate features according to property values.
print('Distinct based on a single property', fc.distinct('fuel1'));
print('Distinct based on two properties', fc.distinct(['fuel1', 'source']));
print('Distinct based on geometry', fc.distinct('.geo'));

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('FeatureCollection of power plants in Belgium:', fc.getInfo())

# Remove duplicate features according to property values.
print('Distinct based on a single property:', fc.distinct('fuel1').getInfo())
print('Distinct based on two properties:',
      fc.distinct(['fuel1', 'source']).getInfo())
print('Distinct based on geometry', fc.distinct('.geo').getInfo())