ee.ImageCollection.distance
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างรูปภาพ DOUBLE โดยที่แต่ละพิกเซลคือระยะทางเป็นเมตรจากกึ่งกลางพิกเซลไปยัง Point, LineString หรือขอบเขตแบบหลายเหลี่ยมที่ใกล้ที่สุดในคอลเล็กชัน โปรดทราบว่าระบบจะวัดระยะทางภายในรูปหลายเหลี่ยมด้วย ระบบจะมาสก์พิกเซลที่อยู่นอกรัศมี "searchRadius" เมตรของรูปทรงเรขาคณิต
ระยะทางจะคำนวณบนทรงกลม จึงอาจมีข้อผิดพลาดเล็กน้อยตามสัดส่วนของความแตกต่างของละติจูดระหว่างแต่ละพิกเซลกับรูปเรขาคณิตที่ใกล้ที่สุด
การใช้งาน | การคืนสินค้า |
---|
ImageCollection.distance(searchRadius, maxError) | รูปภาพ |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ features | FeatureCollection | ชุดฟีเจอร์ที่จะใช้ในการคำนวณระยะทางของพิกเซล |
searchRadius | Float, ค่าเริ่มต้น: 100000 | ระยะทางสูงสุดเป็นเมตรจากแต่ละพิกเซลเพื่อค้นหาขอบ ระบบจะมาสก์พิกเซล เว้นแต่จะมีขอบภายในระยะนี้ |
maxError | Float, ค่าเริ่มต้น: 100 | ข้อผิดพลาดในการฉายซ้ำสูงสุดเป็นเมตร ใช้เฉพาะในกรณีที่เส้นหลายเส้นอินพุตต้องมีการฉายซ้ำ หากระบุ "0" การดำเนินการนี้จะล้มเหลวหากต้องมีการฉายภาพ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eCalculates the distance from each pixel to the nearest geometry (point, line, or polygon) in a collection, measured in meters.\u003c/p\u003e\n"],["\u003cp\u003eOutput is a double image where pixel values represent distances, masked for pixels beyond a specified search radius.\u003c/p\u003e\n"],["\u003cp\u003eDistances are calculated on a sphere, introducing minor errors based on latitude differences.\u003c/p\u003e\n"],["\u003cp\u003eAccepts a FeatureCollection as input and offers parameters to control search radius and reprojection error.\u003c/p\u003e\n"]]],[],null,["# ee.ImageCollection.distance\n\nProduces a DOUBLE image where each pixel is the distance in meters from the pixel center to the nearest Point, LineString, or polygonal boundary in the collection. Note distance is also measured within interiors of polygons. Pixels that are not within 'searchRadius' meters of a geometry will be masked out.\n\n\u003cbr /\u003e\n\nDistances are computed on a sphere, so there is a small error proportional to the latitude difference between each pixel and the nearest geometry.\n\n| Usage | Returns |\n|-------------------------------------------------------------|---------|\n| ImageCollection.distance`(`*searchRadius* `, `*maxError*`)` | Image |\n\n| Argument | Type | Details |\n|------------------|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `features` | FeatureCollection | Feature collection from which to get features used to compute pixel distances. |\n| `searchRadius` | Float, default: 100000 | Maximum distance in meters from each pixel to look for edges. Pixels will be masked unless there are edges within this distance. |\n| `maxError` | Float, default: 100 | Maximum reprojection error in meters, only used if the input polylines require reprojection. If '0' is provided, then this operation will fail if projection is required. |"]]