إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ee.FeatureCollection.makeArray
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
أضِف مصفوفة أحادية البعد إلى كل عنصر في مجموعة من خلال دمج قائمة بالسمات لكل عنصر في مصفوفة أحادية البعد. يجب أن تكون جميع السمات قيمًا رقمية. إذا لم تتضمّن إحدى الميزات جميع الخصائص المسماة، أو إذا لم يكن أيّ منها رقميًا، سيتم إسقاط الميزة من المجموعة الناتجة.
الاستخدام | المرتجعات |
---|
FeatureCollection.makeArray(properties, name) | FeatureCollection |
الوسيطة | النوع | التفاصيل |
---|
هذا: collection | FeatureCollection | مجموعة الإدخال التي سيتم اختيار السمات منها. |
properties | قائمة | السمات المطلوب تحديدها. |
name | سلسلة، القيمة التلقائية: "array" | اسم خاصية المصفوفة الجديدة. |
أمثلة
محرّر الرموز البرمجية (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
راجِع صفحة
بيئة Python للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap
للتطوير التفاعلي.
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())
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003emakeArray()\u003c/code\u003e combines specified numeric properties of features within a FeatureCollection into a new 1-D array property.\u003c/p\u003e\n"],["\u003cp\u003eFeatures lacking any of the specified properties, or containing non-numeric values in those properties, are excluded from the output.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting FeatureCollection contains the original features with an added array property holding the combined values.\u003c/p\u003e\n"],["\u003cp\u003eThe array property is named using the 'name' argument, defaulting to "array" if not provided.\u003c/p\u003e\n"]]],[],null,["# ee.FeatureCollection.makeArray\n\nAdd a 1-D Array to each feature in a collection by combining a list of properties for each feature into a 1-D Array. All of the properties must be numeric values. If a feature doesn't contain all of the named properties, or any of them aren't numeric, the feature will be dropped from the resulting collection.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------|-------------------|\n| FeatureCollection.makeArray`(properties, `*name*`)` | FeatureCollection |\n\n| Argument | Type | Details |\n|--------------------|--------------------------|--------------------------------------------------------------|\n| this: `collection` | FeatureCollection | The input collection from which properties will be selected. |\n| `properties` | List | The properties to select. |\n| `name` | String, default: \"array\" | The name of the new array property. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// FeatureCollection of power plants in Belgium.\nvar fc = ee.FeatureCollection('WRI/GPPD/power_plants')\n .filter('country_lg == \"Belgium\"');\n\n// A list of feature properties to combine into an array\n// (power generation by year).\nvar properties = ['gwh_2013', 'gwh_2014', 'gwh_2015', 'gwh_2016'];\n\n// Add array of power-generation-by-year property to features.\nfc = fc.makeArray(properties, 'gwh_by_year');\n\nprint('FeatureCollection with array of selected properties added', fc);\nprint('See example of new \"gwh_by_year\" property', fc.first().toDictionary());\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nfrom pprint import pprint\n\n# FeatureCollection of power plants in Belgium.\nfc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(\n 'country_lg == \"Belgium\"')\n\n# A list of feature properties to combine into an array\n# (power generation by year).\nproperties = ['gwh_2013', 'gwh_2014', 'gwh_2015', 'gwh_2016']\n\n# Add array of power-generation-by-year property to features.\nfc = fc.makeArray(properties, 'gwh_by_year')\n\nprint('FeatureCollection with array of selected properties added:',\n fc.getInfo())\nprint('See example of new \"gwh_by_year\" property:')\npprint(fc.first().toDictionary().getInfo())\n```"]]