跳转至
🎉 SedonaDB 0.4.0 已正式发布!🗺️ 新增 Python DataFrame API、R dplyr 接口、Geography 支持及 GPU 加速空间连接。阅读发布博客 →

ST_BinaryDistanceBandColumn

Introduction: Introduction: Returns a weights column containing every record in a dataframe within a specified threshold distance.

The weights column is an array of structs containing the attributes from each neighbor and that neighbor's weight. Since this is a binary distance band function, weights of neighbors within the threshold will always be 1.0.

Format: ST_BinaryDistanceBandColumn(geometry:Geometry, threshold: Double, includeZeroDistanceNeighbors: boolean, includeSelf: boolean, useSpheroid: boolean, attributes: Struct)

Return type: Array<Struct<neighbor: Integer, value: Double>>

Since: v1.7.1

SQL Example

ST_BinaryDistanceBandColumn(geometry, 1.0, true, true, false, struct(id, geometry))

Output:

[{{15, POINT (3 1.9)}, 1.0}, {{16, POINT (3 2)}, 1.0}, {{17, POINT (3 2.1)}, 1.0}, {{18, POINT (3 2.2)}, 1.0}]