spatial.addNativePointLayerXY

过程 已弃用

使用给定的 x 和 y 坐标属性添加一个新的点图层,返回图层根节点

此过程已被以下过程取代:spatial.addPointLayerXY

签名

spatial.addNativePointLayerXY(name :: STRING, xProperty :: STRING, yProperty :: STRING, indexType = rtree :: STRING, crsName =  :: STRING, indexConfig =  :: STRING) :: (node :: NODE)

输入参数

名称 类型 默认 描述

名称 (name)

STRING

null

层的名称

xProperty

STRING

null

x 坐标属性的名称

yProperty

STRING

null

y 坐标属性的名称

indexType

STRING

"rtree"

要使用的索引算法类型,有效值为:rtreegeohashzorderhilbert

crsName

STRING

""

要使用的坐标参考系统(CRS),有效值为:wgs84

indexConfig

STRING

""

新创建的索引的配置

输出参数

名称 类型 描述

节点

NODE

示例

创建本地点层

CALL spatial.addNativePointLayerXY('geom','x','y')
表 1. 结果
节点
(:SpatialLayer {
    geomencoder: "SimplePointEncoder",
    geomencoder_config: "x:y",
    index_type: "rtree",
    layer: "geom",
    layer_type: "SimplePointLayer"
})

创建节点并将其添加到索引中

CREATE (n:Node {id: 42, x: 5.0, y: 4.0}) WITH n CALL spatial.addNode('geom',n) YIELD node RETURN node

在指定距离内查找节点

CALL spatial.withinDistance('geom',point({latitude:4.1,longitude:5.1}),100)
表 2. 结果
距离 节点
15.705713907526011
(:Node {
    bbox: [ 5.0, 4.0, 5.0, 4.0 ],
    gtype: 1,
    id: 42,
    x: 5.0,
    y: 4.0
})
© . This site is unofficial and not affiliated with Neo4j, Inc.