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())