إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ee.FeatureCollection.select
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
اختَر مواقع من كل ميزة في مجموعة. يمكن أيضًا استدعاء هذه الدالة باستخدام وسيطات السلسلة فقط، وسيتم تفسيرها جميعًا على أنّها propertySelectors (varargs).
تعرض هذه الدالة مجموعة العناصر مع السمات المحدّدة.
الاستخدام | المرتجعات |
---|
FeatureCollection.select(propertySelectors, newProperties, retainGeometry) | FeatureCollection |
الوسيطة | النوع | التفاصيل |
---|
هذا: featurecollection | FeatureCollection | مثيل FeatureCollection |
propertySelectors | List<String> | قائمة بالأسماء أو التعبيرات العادية التي تحدّد السمات المطلوب اختيارها. |
newProperties | List<String>, اختياري | قائمة بالأسماء الجديدة لسمات الإخراج. يجب أن يتطابق مع عدد المواقع المحدّدة. |
retainGeometry | قيمة منطقية، اختيارية | عندما تكون القيمة خطأ، ستتضمّن النتيجة شكلًا هندسيًا بقيمة NULL. القيمة التلقائية هي "صحيح". |
أمثلة
محرّر الرموز البرمجية (JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// Select a single property.
var singleProp = fc.select('fuel1');
print('Single property selected',
singleProp.first());
// Select multiple properties.
var multiProp = fc.select(['fuel1', 'capacitymw']);
print('Multiple properties selected',
multiProp.first());
// Select multiple properties and rename them.
var multiPropRename = fc.select({
propertySelectors: ['fuel1', 'capacitymw'],
newProperties: ['Fuel_1', 'Capacity_MW']
});
print('Multiple properties selected, renamed',
multiPropRename.first());
// Select multiple properties, remove geometry.
var multiPropNoGeom = fc.select({
propertySelectors: ['fuel1', 'capacitymw'],
retainGeometry: false
});
print('Multiple properties selected, geometry removed',
multiPropNoGeom.first());
إعداد Python
راجِع صفحة
بيئة Python للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap
للتطوير التفاعلي.
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"')
# Select a single property.
single_prop = fc.select('fuel1')
print('Single property selected:', single_prop.first().getInfo())
# Select multiple properties.
multi_prop = fc.select(['fuel1', 'capacitymw'])
print('Multiple properties selected:', multi_prop.first().getInfo())
# Select multiple properties and rename them.
multi_prop_rename = fc.select(**{
'propertySelectors': ['fuel1', 'capacitymw'],
'newProperties': ['Fuel_1', 'Capacity_MW']
})
print('Multiple properties selected, renamed:',
multi_prop_rename.first().getInfo())
# Select multiple properties, remove geometry.
multi_prop_no_geom = fc.select(**{
'propertySelectors': ['fuel1', 'capacitymw'],
'retainGeometry': False
})
print('Multiple properties selected, geometry removed:',
multi_prop_no_geom.first().getInfo())
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003eFeatureCollection.select()\u003c/code\u003e allows you to select specific properties (attributes) from each feature within a FeatureCollection.\u003c/p\u003e\n"],["\u003cp\u003eYou can select properties by their names, rename them, and optionally retain or remove the feature's geometry.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts arguments like \u003ccode\u003epropertySelectors\u003c/code\u003e for specifying properties to select, \u003ccode\u003enewProperties\u003c/code\u003e for renaming them, and \u003ccode\u003eretainGeometry\u003c/code\u003e to control geometry inclusion.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns a new FeatureCollection containing only the selected properties (and potentially modified geometry) for each feature.\u003c/p\u003e\n"]]],[],null,["# ee.FeatureCollection.select\n\n\u003cbr /\u003e\n\nSelect properties from each Feature in a collection. It is also possible to call this function with only string arguments; they will be all be interpreted as propertySelectors (varargs).\n\n\u003cbr /\u003e\n\nReturns the feature collection with selected properties.\n\n| Usage | Returns |\n|---------------------------------------------------------------------------------------|-------------------|\n| FeatureCollection.select`(propertySelectors, `*newProperties* `, `*retainGeometry*`)` | FeatureCollection |\n\n| Argument | Type | Details |\n|---------------------------|--------------------------|----------------------------------------------------------------------------------------------|\n| this: `featurecollection` | FeatureCollection | The FeatureCollection instance. |\n| `propertySelectors` | List\\\u003cString\\\u003e | A list of names or regexes specifying the attributes to select. |\n| `newProperties` | List\\\u003cString\\\u003e, optional | A list of new names for the output properties. Must match the number of properties selected. |\n| `retainGeometry` | Boolean, optional | When false, the result will have a NULL geometry. Defaults to true. |\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// Select a single property.\nvar singleProp = fc.select('fuel1');\nprint('Single property selected',\n singleProp.first());\n\n// Select multiple properties.\nvar multiProp = fc.select(['fuel1', 'capacitymw']);\nprint('Multiple properties selected',\n multiProp.first());\n\n// Select multiple properties and rename them.\nvar multiPropRename = fc.select({\n propertySelectors: ['fuel1', 'capacitymw'],\n newProperties: ['Fuel_1', 'Capacity_MW']\n});\nprint('Multiple properties selected, renamed',\n multiPropRename.first());\n\n// Select multiple properties, remove geometry.\nvar multiPropNoGeom = fc.select({\n propertySelectors: ['fuel1', 'capacitymw'],\n retainGeometry: false\n});\nprint('Multiple properties selected, geometry removed',\n multiPropNoGeom.first());\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\n# FeatureCollection of power plants in Belgium.\nfc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(\n 'country_lg == \"Belgium\"')\n\n# Select a single property.\nsingle_prop = fc.select('fuel1')\nprint('Single property selected:', single_prop.first().getInfo())\n\n# Select multiple properties.\nmulti_prop = fc.select(['fuel1', 'capacitymw'])\nprint('Multiple properties selected:', multi_prop.first().getInfo())\n\n# Select multiple properties and rename them.\nmulti_prop_rename = fc.select(**{\n 'propertySelectors': ['fuel1', 'capacitymw'],\n 'newProperties': ['Fuel_1', 'Capacity_MW']\n })\nprint('Multiple properties selected, renamed:',\n multi_prop_rename.first().getInfo())\n\n# Select multiple properties, remove geometry.\nmulti_prop_no_geom = fc.select(**{\n 'propertySelectors': ['fuel1', 'capacitymw'],\n 'retainGeometry': False\n })\nprint('Multiple properties selected, geometry removed:',\n multi_prop_no_geom.first().getInfo())\n```"]]