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 API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

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