ee.FeatureCollection.draw

繪製用於視覺化的向量集合。不適合做為其他演算法的輸入內容。

用量傳回
FeatureCollection.draw(color, pointRadius, strokeWidth)圖片
引數類型詳細資料
這個:collectionFeatureCollection要繪製的集合。
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 API 和如何使用 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