ee.FeatureCollection.makeArray

با ترکیب لیستی از خصوصیات هر ویژگی در یک آرایه 1 بعدی، به هر ویژگی در مجموعه، یک آرایه 1 بعدی اضافه کنید. همه خصوصیات باید مقادیر عددی باشند. اگر یک ویژگی شامل تمام ویژگی‌های نام‌گذاری شده نباشد، یا هر یک از آنها عددی نباشد، ویژگی از مجموعه به دست آمده حذف می‌شود.

استفاده برمی گرداند
FeatureCollection. makeArray (properties, name ) مجموعه ویژگی ها
استدلال تایپ کنید جزئیات
این: collection مجموعه ویژگی ها مجموعه ورودی که خواص از آن انتخاب خواهد شد.
properties فهرست کنید خواص برای انتخاب
name رشته، پیش فرض: "آرایه" نام ویژگی آرایه جدید.

نمونه ها

ویرایشگر کد (جاوا اسکریپت)

// 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());

راه اندازی پایتون

برای اطلاعات در مورد API پایتون و استفاده از geemap برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.

import ee
import geemap.core as geemap

کولب (پایتون)

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())