spatial.addPointLayerZOrder

过程

添加一个基于 Z 顺序曲线索引的新的简单点图层,并返回该图层的根节点

签名

spatial.addPointLayerZOrder(name :: STRING, indexConfig =  :: STRING) :: (node :: NODE)

输入参数

名称 类型 默认 描述

名称 (name)

STRING

null

层的名称

indexConfig

STRING

""

新创建的索引的配置

输出参数

名称 类型 描述

节点

NODE

示例

创建一个用于索引节点的图层

CALL spatial.addPointLayerZOrder('my-simple-zorder-layer')
表 1. 结果
节点
(:SpatialLayer {
    geomencoder: "SimplePointEncoder",
    index_type: "zorder",
    layer: "my-simple-zorder-layer",
    layer_type: "SimplePointLayer",
    layercrs: "GEOGCS[\"WGS84(DD)\", \n  DATUM[\"WGS84\", \n    SPHEROID[\"WGS84\", 6378137.0, 298.257223563]], \n  PRIMEM[\"Greenwich\", 0.0], \n  UNIT[\"degree\", 0.017453292519943295], \n  AXIS[\"Geodetic longitude\", EAST], \n  AXIS[\"Geodetic latitude\", NORTH], \n  AUTHORITY[\"EPSG\",\"4326\"]]"
})

创建要索引的节点

CREATE (n:Node {id: 42, latitude:60.1,longitude:15.2}) SET n.location=point(n) RETURN n

索引节点

MATCH (n:Node) WITH n CALL spatial.addNode('my-simple-zorder-layer',n) YIELD node RETURN node
表 2. 结果
节点
(:Node:SpatialIndex_zorder_my-simple-zorder-layer {
    _spatialindex_zorder_my-simple-zorder-layer: 4771024,
    bbox: [ 15.2, 60.1, 15.2, 60.1 ],
    gtype: 1,
    id: 42,
    latitude: 60.1,
    location: point({x: 15.2, y: 60.1, crs: 'wgs-84'}),
    longitude: 15.2
})

在指定距离内查找节点

CALL spatial.withinDistance('my-simple-zorder-layer',{lon:15.0,lat:60.0},100)
表 3. 结果
距离 节点
15.713441434310283
(:Node:SpatialIndex_zorder_my-simple-zorder-layer {
    _spatialindex_zorder_my-simple-zorder-layer: 4771024,
    bbox: [ 15.2, 60.1, 15.2, 60.1 ],
    gtype: 1,
    id: 42,
    latitude: 60.1,
    location: point({x: 15.2, y: 60.1, crs: 'wgs-84'}),
    longitude: 15.2
})
© . This site is unofficial and not affiliated with Neo4j, Inc.