ee.FeatureCollection.union

Łączy wszystkie geometrie w danej kolekcji w jedną i zwraca kolekcję zawierającą 1 obiekt z identyfikatorem „union_result” i geometrią.

WykorzystanieZwroty
FeatureCollection.union(maxError)FeatureCollection
ArgumentTypSzczegóły
to: collectionFeatureCollectionKolekcja, która jest scalana.
maxErrorErrorMargin, domyślnie: nullMaksymalny dopuszczalny błąd podczas wykonywania niezbędnych przekształceń. Jeśli nie podasz tu żadnej wartości, zostanie użyta domyślna wartość marginesu błędu żądana w danych wyjściowych.

Przykłady

Edytor kodu (JavaScript)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
            .filter('country_lg == "Belgium"');

print('Original FeatureCollection', fc);

// Merge all geometries into one. A FeatureCollection with a single feature
// with no properties is returned.
print('All geometries merged into one', fc.union(1));

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('Original FeatureCollection:', fc.getInfo())

# Merge all geometries into one. A FeatureCollection with a single feature
# with no properties is returned.
print('All geometries merged into one:', fc.union(1).getInfo())