ee.Geometry.Point.convexHull

แสดงผลฮัลล์นูนของเรขาคณิตที่ระบุ ฮัลล์นูนของจุดเดียวคือจุดนั้นเอง ฮัลล์นูนของจุดที่อยู่บนเส้นตรงเดียวกันคือเส้นตรง และฮัลล์นูนของทุกอย่างที่เหลือคือรูปหลายเหลี่ยม โปรดทราบว่ารูปหลายเหลี่ยมที่เสื่อมสภาพซึ่งมีจุดยอดทั้งหมดอยู่บนเส้นเดียวกันจะส่งผลให้เกิดส่วนของเส้น

การใช้งานการคืนสินค้า
Point.convexHull(maxError, proj)เรขาคณิต
อาร์กิวเมนต์ประเภทรายละเอียด
ดังนี้ geometryเรขาคณิตคำนวณฮัลล์นูนของเรขาคณิตนี้
maxErrorErrorMargin, ค่าเริ่มต้น: nullปริมาณข้อผิดพลาดสูงสุดที่ยอมรับได้เมื่อทำการฉายซ้ำที่จำเป็น
projการฉายภาพ ค่าเริ่มต้น: nullการฉายภาพที่จะใช้ดำเนินการ หากไม่ได้ระบุ ระบบจะดำเนินการในระบบพิกัดทรงกลม และระยะทางเชิงเส้นจะเป็นหน่วยเมตรบนทรงกลม

ตัวอย่าง

โปรแกรมแก้ไขโค้ด (JavaScript)

// Define a Point object.
var point = ee.Geometry.Point(-122.082, 37.42);

// Apply the convexHull method to the Point object.
var pointConvexHull = point.convexHull({'maxError': 1});

// Print the result to the console.
print('point.convexHull(...) =', pointConvexHull);

// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(point,
             {'color': 'black'},
             'Geometry [black]: point');
Map.addLayer(pointConvexHull,
             {'color': 'red'},
             'Result [red]: point.convexHull');

การตั้งค่า Python

ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

import ee
import geemap.core as geemap

Colab (Python)

# Define a Point object.
point = ee.Geometry.Point(-122.082, 37.42)

# Apply the convexHull method to the Point object.
point_convex_hull = point.convexHull(maxError=1)

# Print the result.
display('point.convexHull(...) =', point_convex_hull)

# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(point, {'color': 'black'}, 'Geometry [black]: point')
m.add_layer(
    point_convex_hull, {'color': 'red'}, 'Result [red]: point.convexHull'
)
m