首页 > 解决方案 > 如何在 Neo4j 中创建 geohash 树

问题描述

基于此处的问题,专家已使用此代码回答:

CALL spatial.addPointLayerGeohash('my_geohash_layer_name')
CREATE (n:Node {latitude:60.1,longitude:15.2}) WITH n 
CALL spatial.addNode('my_geohash_layer_name',n) YIELD node 
RETURN node

创建一个组织空间节点的geohash树。

所以我尝试了两个空间节点,但与 R-tree 不同的是,空间节点没有通过任何连接链接到层!?这段代码是真的吗?或者有什么问题?在此处输入图像描述

标签: cypherneo4j-spatial

解决方案


如果你想要一个 in-graph 树结构作为索引,你需要使用 RTree 索引(这是 Neo4j Spatial 中的默认值)。如果你想要一个 geohash 索引,图中将没有树,因为 geohash 被存储为字符串前缀搜索的 lucene 索引中的字符串。字符串前缀搜索是搜索基于 geohash 的索引的常用方法。


推荐阅读