公告 :所有在
2025 年 4 月 15 日 之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件 ,才能继续使用 Earth Engine。
发送反馈
嘉实基金詹凌蔚:预计后市箱体震荡 看好钢铁航运
当且仅当几何图形位于指定距离内时,返回 true。
百度 对于附属性有闲阶级则分类对待,对于劳动者阶级,凡氏总体上持维护态度。
用法 返回 MultiLineString. withinDistance (right, distance, maxError , proj )
布尔值
参数 类型 详细信息 此:left
几何图形 用作运算左操作数的几何图形。 right
几何图形 用作相应运算的右操作数的几何图形。 distance
浮点数 距离阈值。如果指定了投影,则距离单位为相应投影坐标系的单位;否则,距离单位为米。 maxError
ErrorMargin,默认值: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 ]]]);
// Define other inputs.
var inputGeom = ee . Geometry . Point ( - 122.090 , 37.423 );
// Apply the withinDistance method to the MultiLineString object.
var multiLineStringWithinDistance = multiLineString . withinDistance ({ 'right' : inputGeom , 'distance' : 500 , 'maxError' : 1 });
// Print the result to the console.
print ( 'multiLineString.withinDistance(...) =' , multiLineStringWithinDistance );
// Display relevant geometries on the map.
Map . setCenter ( - 122.085 , 37.422 , 15 );
Map . addLayer ( multiLineString ,
{ 'color' : 'black' },
'Geometry [black]: multiLineString' );
Map . addLayer ( inputGeom ,
{ 'color' : 'blue' },
'Parameter [blue]: inputGeom' );
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 ]],
])
# Define other inputs.
input_geom = ee . Geometry . Point ( - 122.090 , 37.423 )
# Apply the withinDistance method to the MultiLineString object.
multilinestring_within_distance = multilinestring . withinDistance (
right = input_geom , distance = 500 , maxError = 1
)
# Print the result.
display (
'multilinestring.withinDistance(...) =' , multilinestring_within_distance
)
# 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 . add_layer ( input_geom , { 'color' : 'blue' }, 'Parameter [blue]: input_geom' )
m
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
需要向我们提供更多信息?
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-04。"],[[["Determines if a geometry is within a specified distance of a MultiLineString geometry."],["Returns true if the geometries are within the given distance threshold, otherwise returns false."],["The distance can be specified in meters or in the units of a projected coordinate system."],["Accepts optional arguments for error margin and projection for reprojection purposes."]]],[]]