ee.FeatureCollection.distinct

Menghapus duplikat dari koleksi. Perhatikan bahwa duplikat ditentukan menggunakan hash kuat atas bentuk berserial dari properti yang dipilih.

PenggunaanHasil
FeatureCollection.distinct(properties)FeatureCollection
ArgumenJenisDetail
ini: collectionFeatureCollectionKumpulan input tempat objek akan dipilih.
propertiesObjekNama properti atau daftar nama properti yang akan digunakan untuk perbandingan. Properti '.geo' dapat disertakan untuk membandingkan geometri objek.

Contoh

Code Editor (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'));

Penyiapan Python

Lihat halaman Lingkungan Python untuk mengetahui informasi tentang Python API dan penggunaan geemap untuk pengembangan interaktif.

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