ee.Feature.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.
Trả về khoảng cách tối thiểu giữa hình học của hai đối tượng.
Cách sử dụng | Giá trị trả về |
---|
Feature.distance(right, maxError, proj, spherical) | Số thực dấu phẩy động |
Đối số | Loại | Thông tin chi tiết |
---|
this: left | Phần tử | Đối tượng chứa hình học được dùng làm toán hạng bên trái của phép toán. |
right | Phần tử | Đối tượng chứa hình học được dùng làm toán hạng bên phải của phép toán. |
maxError | ErrorMargin, mặc định: rỗng | Mức độ sai số tối đa được chấp nhận khi thực hiện bất kỳ phép chiếu lại nào cần thiết. |
proj | Hình chiếu, mặc định: rỗng | Hình chiếu để thực hiện phép toán. Nếu không được chỉ định, phép toán sẽ được thực hiện trong hệ toạ độ hình cầu và khoảng cách tuyến tính sẽ tính bằng mét trên hình cầu. |
spherical | Boolean, mặc định: false | Nếu đúng, phép tính sẽ được thực hiện trên hình cầu đơn vị. Nếu giá trị là false, phép tính sẽ là hình elip, có tính đến độ phẳng của Trái Đất. Bỏ qua nếu bạn chỉ định proj. Mặc định là sai. |
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-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eMeasures the shortest distance between two geographical features.\u003c/p\u003e\n"],["\u003cp\u003eAccepts two features as input, along with optional parameters for error margin and projection.\u003c/p\u003e\n"],["\u003cp\u003eReturns the calculated distance as a floating-point number, representing the separation between the features.\u003c/p\u003e\n"],["\u003cp\u003eIf a projection is not specified, calculations default to a spherical coordinate system with distances in meters.\u003c/p\u003e\n"],["\u003cp\u003eAllows for specifying an error margin to manage the accuracy of calculations, particularly during reprojection.\u003c/p\u003e\n"]]],[],null,["# ee.Feature.distance\n\nReturns the minimum distance between the geometries of two features.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------|---------|\n| Feature.distance`(right, `*maxError* `, `*proj* `, `*spherical*`)` | Float |\n\n| Argument | Type | Details |\n|--------------|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `left` | Element | The feature containing the geometry used as the left operand of the operation. |\n| `right` | Element | The feature containing the geometry used as the right operand of the operation. |\n| `maxError` | ErrorMargin, default: null | The maximum amount of error tolerated when performing any necessary reprojection. |\n| `proj` | Projection, default: null | The projection in which to perform the operation. If not specified, the operation will be performed in a spherical coordinate system, and linear distances will be in meters on the sphere. |\n| `spherical` | Boolean, default: false | If true, the calculation will be done on the unit sphere. If false, the calculation will be elliptical, taking earth flattening into account. Ignored if proj is specified. Default is false. |"]]