ee.Geometry.MultiLineString.area

แสดงผลพื้นที่ของเรขาคณิต พื้นที่ของจุดและสตริงของเส้นคือ 0 และพื้นที่ของเรขาคณิตแบบหลายรายการคือผลรวมของพื้นที่ของคอมโพเนนต์ (ระบบจะนับพื้นที่ที่ตัดกันหลายครั้ง)

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

ตัวอย่าง

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

// Define a MultiLineString object.
var multiLineString = ee.Geometry.MultiLineString(
   [[[-122.088, 37.418], [-122.086, 37.422], [-122.082, 37.418]],
    [[-122.087, 37.416], [-122.083, 37.416], [-122.082, 37.419]]]);

// Apply the area method to the MultiLineString object.
var multiLineStringArea = multiLineString.area({'maxError': 1});

// Print the result to the console.
print('multiLineString.area(...) =', multiLineStringArea);

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

การตั้งค่า Python

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

import ee
import geemap.core as geemap

Colab (Python)

# Define a MultiLineString object.
multilinestring = ee.Geometry.MultiLineString([
    [[-122.088, 37.418], [-122.086, 37.422], [-122.082, 37.418]],
    [[-122.087, 37.416], [-122.083, 37.416], [-122.082, 37.419]],
])

# Apply the area method to the MultiLineString object.
multilinestring_area = multilinestring.area(maxError=1)

# Print the result.
display('multilinestring.area(...) =', multilinestring_area)

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