ee.FeatureCollection.map

Bir koleksiyon üzerinde bir algoritmayı eşler.

Eşlenen koleksiyonu döndürür.

Kullanımİadeler
FeatureCollection.map(algorithm, dropNulls)Koleksiyon
Bağımsız DeğişkenTürAyrıntılar
bu: collectionKoleksiyonKoleksiyon örneği.
algorithmİşlevKoleksiyonun resimleri veya özellikleri üzerinde eşlenecek işlem. Bir resim veya özellik alan ve bir resim ya da özellik döndüren JavaScript işlevi. İşlev yalnızca bir kez çağrılır ve sonuç bir açıklama olarak yakalanır. Bu nedenle, zorunlu işlemleri gerçekleştiremez veya harici duruma bağlı olamaz.
dropNullsBoole, isteğe bağlıDoğru ise eşlenen algoritmanın boş değer döndürmesine izin verilir ve boş değer döndürdüğü öğeler bırakılır.

Örnekler

Kod Düzenleyici (JavaScript)

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

// Function to convert power plant capacity from megawatts to gigawatts and
// add the value as a new feature property.
var mwToGw = function(feature) {
  var megawatt = feature.getNumber('capacitymw');
  var gigawatt = megawatt.divide(1000);
  return feature.set('capacitygw', gigawatt);
};

// Apply the function to each feature in the collection.
fc = fc.map(mwToGw);

print('Note the new "capacitygw" property in each feature', fc);

Python kurulumu

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

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"')

# Function to convert power plant capacity from megawatts to gigawatts and
# add the value as a new feature property.
def mw_to_gw(feature):
  megawatt = feature.getNumber('capacitymw')
  gigawatt = megawatt.divide(1000)
  return feature.set('capacitygw', gigawatt)

# Apply the function to each feature in the collection.
fc = fc.map(mw_to_gw)

display('Note the new "capacitygw" property in each feature:', fc)