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 Environment.

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