ee.FeatureCollection.distinct

Usuwa duplikaty z kolekcji. Duplikaty są określane na podstawie silnego skrótu serializowanej formy wybranych właściwości.

WykorzystanieZwroty
FeatureCollection.distinct(properties)FeatureCollection
ArgumentTypSzczegóły
to: collectionFeatureCollectionKolekcja wejściowa, z której będą wybierane obiekty.
propertiesObiektNazwa właściwości lub lista nazw właściwości do wykorzystania w porównaniu. Możesz uwzględnić właściwość „.geo”, aby porównać geometrie obiektów.

Przykłady

Edytor kodu (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'));

Konfiguracja Pythona

Informacje o interfejsie Python API i używaniu geemap do interaktywnego programowania znajdziesz na stronie Środowisko 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())