إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ee.FeatureCollection.draw
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
ترسم هذه الدالة مجموعة من الرسومات المتجهة لإنشاء تمثيل مرئي. لا يُقصد استخدامه كمدخل لخوارزميات أخرى.
الاستخدام | المرتجعات |
---|
FeatureCollection.draw(color, pointRadius, strokeWidth) | صورة |
الوسيطة | النوع | التفاصيل |
---|
هذا: collection | FeatureCollection | المجموعة المطلوب رسمها. |
color | سلسلة | سلسلة سداسية عشرية بالتنسيق RRGGBB تحدّد اللون المستخدَم لرسم العناصر. |
pointRadius | عدد صحيح، القيمة التلقائية: 3 | تمثّل هذه السمة نصف قطر علامات النقاط بالبكسل. |
strokeWidth | عدد صحيح، القيمة التلقائية: 2 | تمثّل هذه السمة عرض الخطوط وحدود المضلّعات بالبكسل. |
أمثلة
محرّر الرموز البرمجية (JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// Paint FeatureCollection to an image for visualization.
var fcVis = fc.draw({color: '800080', pointRadius: 5, strokeWidth: 3});
Map.setCenter(4.56, 50.78, 8);
Map.addLayer(fcVis);
إعداد 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"'
)
# Paint FeatureCollection to an image for visualization.
fc_vis = fc.draw(color='800080', pointRadius=5, strokeWidth=3)
m = geemap.Map()
m.set_center(4.56, 50.78, 8)
m.add_layer(fc_vis)
m
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003edraw()\u003c/code\u003e visualizes FeatureCollections as images for display purposes, not for algorithmic input.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts color, point radius, and stroke width parameters to customize the visualization.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003edraw()\u003c/code\u003e with FeatureCollections to create image overlays for maps, as demonstrated with the power plants example.\u003c/p\u003e\n"]]],["The `FeatureCollection.draw()` method visualizes a feature collection as an image. It accepts a `FeatureCollection`, a `color` (hex string), `pointRadius` (integer, default 3), and `strokeWidth` (integer, default 2). The method returns an image and is intended for visualization, not algorithmic input. The examples demonstrate how to apply this method using the power plants of Belgium. It can be done in JavaScript or python (colab or not) and the visualization will be an image.\n"],null,["# ee.FeatureCollection.draw\n\nPaints a vector collection for visualization. Not intended for use as input to other algorithms.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------|---------|\n| FeatureCollection.draw`(color, `*pointRadius* `, `*strokeWidth*`)` | Image |\n\n| Argument | Type | Details |\n|--------------------|---------------------|-----------------------------------------------------------------------------------------|\n| this: `collection` | FeatureCollection | The collection to draw. |\n| `color` | String | A hex string in the format RRGGBB specifying the color to use for drawing the features. |\n| `pointRadius` | Integer, default: 3 | The radius in pixels of the point markers. |\n| `strokeWidth` | Integer, default: 2 | The width in pixels of lines and polygon borders. |\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// Paint FeatureCollection to an image for visualization.\nvar fcVis = fc.draw({color: '800080', pointRadius: 5, strokeWidth: 3});\nMap.setCenter(4.56, 50.78, 8);\nMap.addLayer(fcVis);\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\n# Paint FeatureCollection to an image for visualization.\nfc_vis = fc.draw(color='800080', pointRadius=5, strokeWidth=3)\nm = geemap.Map()\nm.set_center(4.56, 50.78, 8)\nm.add_layer(fc_vis)\nm\n```"]]