赞
踩
Neo4j空间索引可以对数据进行空间索引,例如在指定区域内以某个感兴趣的点作为起始,搜索指定距离内其它感兴趣的点。可以方便地将空间索引的节点数据与已有图数据结合分析。
CALL spatial.addPointLayer('geom')
CALL spatial.layers()
MERGE (n:Node {longitude:15.2,latitude:60.1}) WITH n
CALL spatial.addNode('geom',n) YIELD node RETURN node
CALL spatial.bbox('geom',{longitude:15.0,latitude:60.0},{longitude:15.3,latitude:60.2}) YIELD node RETURN node
// 将*.shp,*.dbf,*.shx文件移动到neo4j安装根目录下
CALL spatial.addWKTLayer('layer_roads','geometry')
CALL spatial.importShapefileToLayer('layer_roads','roa_4m.shp')
CALL spatial.bbox('layer_roads',{longitude:14.0,latitude:60.0},{longitude:19.3,latitude:81.0}) YIELD node RETURN node.name as name
WITH "POLYGON((15.3 60.0,15.3 62.0,15.2 60.2,15.4 65.0))" as polygon
CALL spatial.intersects('layer_roads', polygon) YIELD node RETURN node.name as name
CALL spatial.withinDistance('geom',{longitude:15.2,latitude:60.1},0.1) YIELD node RETURN node LIMIT 10
CALL spatial.addPointLayer('geom')
UNWIND [{name:'a',latitude:60.1,longitude:15.2},{name:'b',latitude:60.3,longitude:15.5}] as point CREATE (n:Node) SET n += point WITH n
CALL spatial.addNode('geom',n) YIELD node RETURN node.name as name
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。