SpatiaLite:用于多维数据的 RTreeDistWithin

SpatiaLite: RTreeDistWithin for multidimensional data

RTreeDistWithin( x Double precision , y Double precision , radius Double precision )

此函数从 R*Tree 空间索引中检索其 MBR 与给定圆上外接的正方形相交的任何实体。有3维及以上数据的模拟吗?

SpatiaLite 中没有任何 R*Tree 相关函数的三维或 n 维实现。根据the documentation:

(...) an R*Tree defines a tree-like structure based on rectangles (the R in R*Tree stands exactly for Rectangle).

一般来说,空间数据库和空间索引是为了管理空间数据(将空间数据理解为地理数据)而设计的,所以感兴趣的坐标是X和Y(或longitude/latitude)。 Z(或高度)不太重要,在使用空间索引时不会考虑。

因此,简而言之,Spatialite 并非设计用于处理 n 维数据,您无法在 SpatiaLite 中定义 n 维(n > 2)R*Tree 空间索引。您可能需要考虑您要使用 SpatiaLite 做什么,因为这可能不是实现您目标的正确工具。

作为解决方法,如果您仍想使用空间数据库来存储数据,您可以将 n 维数据视为其在二维平面中的投影。每个投影都将存储在具有空间索引的 table 中(您将需要 n-1 个投影来管理 n 维数据)。