ee.FeatureCollection.draw

Vẽ một tập hợp vectơ để trực quan hoá. Không dùng làm dữ liệu đầu vào cho các thuật toán khác.

Cách sử dụngGiá trị trả về
FeatureCollection.draw(color, pointRadius, strokeWidth)Hình ảnh
Đối sốLoạiThông tin chi tiết
this: collectionFeatureCollectionBộ sưu tập cần vẽ.
colorChuỗiMột chuỗi thập lục phân ở định dạng RRGGBB chỉ định màu dùng để vẽ các đối tượng.
pointRadiusSố nguyên, mặc định: 3Bán kính tính bằng pixel của các điểm đánh dấu.
strokeWidthSố nguyên, mặc định: 2Chiều rộng tính bằng pixel của các đường kẻ và đường viền đa giác.

Ví dụ

Trình soạn thảo mã (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);

Thiết lập Python

Hãy xem trang Môi trường Python để biết thông tin về API Python và cách sử dụng geemap cho quá trình phát triển tương tác.

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