首页 文章

泰坦的地理空间顶点中心指数可能吗?

提问于
浏览
0

是否有可能在泰坦制作地理空间顶点中心指数?

我已经尝试按照指南https://github.com/thinkaurelius/titan/wiki/Vertex-Centric-Indices中的模式在rexster控制台中创建一个模式,但是失败了 .

geo_location=g.makeKey("geo_location").dataType(Geoshape.class).make();
g.makeLabel("edge_label").sortKey(geo).signature(geo).make();

==>An error occurred while processing the script for language [groovy].
All transactions across all graphs in the session have been concluded with failure:    
java.util.concurrent.ExecutionException:
javax.script.ScriptException: 
javax.script.ScriptException:
java.lang.IllegalArgumentException:
Key must have comparable data type to be used as sort key: geo_location

我已经尝试过创建一个常规的地理空间索引,但是当查询具有大量边缘且具有相关地理空间属性的顶点时,这会产生较低的性能 .

我设想这能够执行以下操作并检索圆内的所有边,最好按距(x,y)的距离排序 .

x = 0
y = 0
radius = 10
circle = Geoshape.circle(current_position_x, current_position_y, nearby_radius)
some_vertex_with_centric_index.outE('edge_label').has(location, WITHIN, circle)

使用Titan Server 0.4.4 w / Cassandra 2.0.3弹性搜索

1 回答

  • 0

    我不认为这是/可能的 . 按键排序边缘按升序或降序排序 . 您如何按任何顺序对位置进行排序?在你的情况下我会做的是:

    • 预先计算从顶点A到顶点B的距离

    • 将预先计算的距离存储为边缘属性

    • 使用预先计算的距离作为排序键

    然后像这样查询:

    location.outE('edge_label').has('distance', T.lte, radius).inV()
    

    干杯,丹尼尔

相关问题