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 للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام geemap للتطوير التفاعلي.

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