ee.FeatureCollection.makeArray

Her bir özellik için özellik listesini 1 boyutlu bir diziye birleştirerek koleksiyondaki her bir özelliğe 1 boyutlu bir dizi ekleyin. Tüm özellikler sayısal değerler olmalıdır. Bir özellik, adlandırılmış özelliklerin tümünü içermiyorsa veya bunlardan herhangi biri sayısal değilse özellik, sonuçta elde edilen koleksiyondan çıkarılır.

Kullanımİadeler
FeatureCollection.makeArray(properties, name)FeatureCollection
Bağımsız DeğişkenTürAyrıntılar
bu: collectionFeatureCollectionMülklerin seçileceği giriş koleksiyonu.
propertiesListeSeçilecek özellikler.
nameDize, varsayılan: "array"Yeni dizi özelliğinin adı.

Örnekler

Kod Düzenleyici (JavaScript)

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

// A list of feature properties to combine into an array
// (power generation by year).
var properties = ['gwh_2013', 'gwh_2014', 'gwh_2015', 'gwh_2016'];

// Add array of power-generation-by-year property to features.
fc = fc.makeArray(properties, 'gwh_by_year');

print('FeatureCollection with array of selected properties added', fc);
print('See example of new "gwh_by_year" property', fc.first().toDictionary());

Python kurulumu

Python API'si ve etkileşimli geliştirme için geemap kullanımı hakkında bilgi edinmek üzere Python Ortamı sayfasına bakın.

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

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

# A list of feature properties to combine into an array
# (power generation by year).
properties = ['gwh_2013', 'gwh_2014', 'gwh_2015', 'gwh_2016']

# Add array of power-generation-by-year property to features.
fc = fc.makeArray(properties, 'gwh_by_year')

print('FeatureCollection with array of selected properties added:',
      fc.getInfo())
print('See example of new "gwh_by_year" property:')
pprint(fc.first().toDictionary().getInfo())