ee.FeatureCollection.union

Объединяет все геометрии в заданной коллекции в одну и возвращает коллекцию, содержащую один объект только с идентификатором «union_result» и геометрией.

Использование Возврат
FeatureCollection. union ( maxError ) FeatureCollection
Аргумент Тип Подробности
это: collection FeatureCollection Коллекция объединяется.
maxError ErrorMargin, по умолчанию: null Максимально допустимая погрешность при выполнении любых необходимых перепроецирований. Если не указано, по умолчанию используется погрешность, запрошенная для выходных данных.

Примеры

Редактор кода (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));

Настройка 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('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())