إشعار: يجب
إثبات الأهلية للاستخدام غير التجاري لجميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إليها. إذا لم يتم تأكيد حسابك بحلول 26 سبتمبر 2025، قد يتم تعليق إمكانية الوصول إليه.
ee.FeatureCollection.style
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
ارسم مجموعة متجهات للعرض المرئي باستخدام لغة نمط بسيطة.
| الاستخدام | المرتجعات |
|---|
FeatureCollection.style(color, pointSize, pointShape, width, fillColor, styleProperty, neighborhood, lineType) | صورة |
| الوسيطة | النوع | التفاصيل |
|---|
هذا: collection | FeatureCollection | المجموعة المطلوب رسمها. |
color | سلسلة، القيمة التلقائية: "أسود" | لون تلقائي (قيمة لون CSS 3.0، مثل FF0000 أو red) لاستخدامها في رسم العناصر. تتيح التعتيم (مثلاً، FF000088 (للون الأحمر الشفاف بنسبة% 50). |
pointSize | عدد صحيح، القيمة التلقائية: 3 | الحجم التلقائي لعلامات النقاط بالبكسل |
pointShape | سلسلة، القيمة التلقائية: "circle" | الشكل التلقائي للعلامة التي سيتم رسمها في كل موقع جغرافي إحدى القيم التالية: `circle` أو `square` أو `diamond` أو `cross` أو `plus` أو `pentagram` أو `hexagram` أو `triangle` أو `triangle_up` أو `triangle_down` أو `triangle_left` أو `triangle_right` أو `pentagon` أو `hexagon` أو `star5` أو `star6`. تقبل هذه السمة أيضًا اختصارات علامات Matlab التالية: `o` و`s` و`d` و`x` و`+` و`p` و`h` و`^` و`v` و`<` و`>`. |
width | Float، القيمة التلقائية: 2 | عرض الخط التلقائي للخطوط والمخططات التفصيلية للمضلعات وأشكال النقاط |
fillColor | سلسلة، القيمة التلقائية: null | لون تعبئة المضلّعات وأشكال النقاط القيمة التلقائية هي "لون" بدرجة تعتيم 0.66. |
styleProperty | سلسلة، القيمة التلقائية: null | سمة لكل ميزة من المتوقّع أن تحتوي على قاموس. وتلغي القيم في القاموس أي قيم تلقائية لتلك الميزة. |
neighborhood | عدد صحيح، القيمة التلقائية: 5 | في حال استخدام styleProperty وكان أي عنصر يحتوي على pointSize أو عرض أكبر من القيم التلقائية، يمكن أن تحدث تشوّهات في التجانب. تحدّد هذه السمة الحد الأقصى للمنطقة المجاورة (pointSize + width) المطلوبة لأي معلم. |
lineType | سلسلة، القيمة التلقائية: "solid" | نمط الخط التلقائي للخطوط والمخططات التفصيلية للمضلعات وأشكال النقاط القيمة التلقائية هي "solid". أحد الخيارات التالية: متصل، منقّط، متقطّع |
أمثلة
محرّر الرموز البرمجية (JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// Paint FeatureCollection to an image using collection-wide style arguments.
var fcVis = fc.style({
color: '1e90ff',
width: 2,
fillColor: 'ff475788', // with alpha set for partial transparency
lineType: 'dotted',
pointSize: 10,
pointShape: 'circle'
});
// Display the FeatureCollection visualization (ee.Image) on the map.
Map.setCenter(4.326, 50.919, 9);
Map.addLayer(fcVis, null, 'Collection-wide style');
// Paint FeatureCollection to an image using feature-specific style arguments.
// A dictionary of style properties per power plant fuel type.
var fuelStyles = ee.Dictionary({
Wind: {color: 'blue', pointSize: 5, pointShape: 'circle'},
Gas: {color: 'yellow', pointSize: 6, pointShape: 'square'},
Oil: {color: 'green', pointSize: 3, pointShape: 'diamond'},
Coal: {color: 'red', pointSize: 3, pointShape: 'cross'},
Hydro: {color: 'brown', pointSize: 3, pointShape: 'star5'},
Biomass: {color: 'orange', pointSize: 4, pointShape: 'triangle'},
Nuclear: {color: 'purple', pointSize: 6, pointShape: 'hexagram'},
});
// Add feature-specific style properties to each feature based on fuel type.
fc = fc.map(function(feature) {
return feature.set('style', fuelStyles.get(feature.get('fuel1')));
});
// Style the FeatureCollection according to each feature's "style" property.
var fcVisCustom = fc.style({
styleProperty: 'style',
neighborhood: 8 // maximum "pointSize" + "width" among features
});
// Display the FeatureCollection visualization (ee.Image) on the map.
Map.addLayer(fcVisCustom, null, 'Feature-specific style');
إعداد 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 using collection-wide style arguments.
fc_vis = fc.style(
color='1e90ff',
width=2,
fillColor='ff475788', # with alpha set for partial transparency
lineType='dotted',
pointSize=10,
pointShape='circle',
)
# Display the FeatureCollection visualization (ee.Image) on the map.
m = geemap.Map()
m.set_center(4.326, 50.919, 9)
m.add_layer(fc_vis, None, 'Collection-wide style')
# Paint FeatureCollection to an image using feature-specific style arguments.
# A dictionary of style properties per power plant fuel type.
fuel_styles = ee.Dictionary({
'Wind': {'color': 'blue', 'pointSize': 5, 'pointShape': 'circle'},
'Gas': {'color': 'yellow', 'pointSize': 6, 'pointShape': 'square'},
'Oil': {'color': 'green', 'pointSize': 3, 'pointShape': 'diamond'},
'Coal': {'color': 'red', 'pointSize': 3, 'pointShape': 'cross'},
'Hydro': {'color': 'brown', 'pointSize': 3, 'pointShape': 'star5'},
'Biomass': {'color': 'orange', 'pointSize': 4, 'pointShape': 'triangle'},
'Nuclear': {'color': 'purple', 'pointSize': 6, 'pointShape': 'hexagram'},
})
# Add feature-specific style properties to each feature based on fuel type.
fc = fc.map(
lambda feature: feature.set('style', fuel_styles.get(feature.get('fuel1')))
)
# Style the FeatureCollection according to each feature's "style" property.
fc_vis_custom = fc.style(
styleProperty='style',
neighborhood=8, # maximum "pointSize" + "width" among features
)
# Display the FeatureCollection visualization (ee.Image) on the map.
m.add_layer(fc_vis_custom, None, 'Feature-specific style')
m
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[]]