apoc.algo.aStarWithPoint

过程 Apoc 扩展

等同于 apoc.algo.aStar(存在于 APOC Core 中),但接受 Point 类型作为 pointProperty,而不是接受纬度和经度属性作为 Number 类型

签名

apoc.algo.aStarWithPoint(startNode :: NODE, endNode :: NODE, relationshipTypesAndDirections :: STRING, weightPropertyName :: STRING, pointPropertyName :: STRING) :: (path :: PATH?, weight :: FLOAT?, totalCost :: FLOAT?, nodes :: LIST<NODE>, relationships :: LIST<RELATIONSHIP>)

输入参数

名称 类型 默认

startNode

NODE

null

endNode

NODE

null

relationshipTypesAndDirections

STRING

null

weightPropertyName

STRING

null

pointPropertyName

STRING

null

输出参数

名称 类型

path

PATH?

weight

FLOAT?

totalCost

FLOAT?

节点

LIST<NODE>

relationships

LIST<RELATIONSHIP>

用法示例

MATCH (from:City {name:'München'}), (to:City {name:'Hamburg'})
CALL apoc.algo.aStarWithPoint(from, to, 'DIRECT', 'dist', 'coords') yield path, weight
RETURN path, weight
表 1. 结果
weight path

697430.0

(:City {name: "München",lon: 11.5755,lat: 48.1374,coords: point({srid:4979, x:11.5755, y:48.1374, z:1})})←[:DIRECT {dist: 304280.0}]-(:City {name: "Frankfurt",lon: 8.68333,lat: 50.1167,coords: point({srid:4979, x:8.68333, y:50.1167, z:1})})-[:DIRECT {dist: 393150.0}]→(:City {name: "Hamburg",lon: 9.994583,lat: 53.554423,coords: point({srid:4979, x:9.994583, y:53.554423, z:1})})

© . This site is unofficial and not affiliated with Neo4j, Inc.