ee.ImageCollection.distance
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tạo ra một hình ảnh DOUBLE, trong đó mỗi pixel là khoảng cách (tính bằng mét) từ tâm pixel đến Điểm, LineString hoặc ranh giới đa giác gần nhất trong tập hợp. Khoảng cách của nốt nhạc cũng được đo trong nội thất của đa giác. Những pixel không nằm trong phạm vi "searchRadius" mét của một hình học sẽ bị che khuất.
Khoảng cách được tính trên một hình cầu, vì vậy sẽ có một sai số nhỏ tỷ lệ với sự khác biệt về vĩ độ giữa mỗi pixel và hình học gần nhất.
| Cách sử dụng | Giá trị trả về |
|---|
ImageCollection.distance(searchRadius, maxError) | Hình ảnh |
| Đối số | Loại | Thông tin chi tiết |
|---|
this: features | FeatureCollection | Tập hợp đối tượng mà từ đó lấy các đối tượng dùng để tính khoảng cách giữa các pixel. |
searchRadius | Độ chính xác đơn, mặc định: 100000 | Khoảng cách tối đa (tính bằng mét) từ mỗi pixel để tìm các cạnh. Các pixel sẽ được che đi trừ phi có các cạnh trong khoảng cách này. |
maxError | Độ chính xác đơn, mặc định: 100 | Lỗi chiếu lại tối đa tính bằng mét, chỉ được dùng nếu các đường nhiều đoạn đầu vào yêu cầu chiếu lại. Nếu bạn cung cấp "0", thì thao tác này sẽ không thành công nếu cần có phép chiếu. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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. |"]]