ee.FeatureCollection.distinct

Удаляет дубликаты из коллекции. Обратите внимание, что дубликаты определяются с помощью стойкого хэша сериализованной формы выбранных свойств.

Использование Возврат
FeatureCollection. distinct (properties) FeatureCollection
Аргумент Тип Подробности
это: collection FeatureCollection Входная коллекция, из которой будут выбираться объекты.
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

Информацию об API Python и использовании 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())