示例图集
以下示例根据该图集运行:

distance()
计算两个地点间的直线距离。
语法 | distance(<point1>, <point2>) |
||
参数 | 名称 | 类型 | 描述 |
<point1> |
POINT |
第一个点 | |
<point2> |
POINT |
第二个点 | |
返回类型 | DOUBLE |
MATCH (n1:City {name: 'New York'})
MATCH (n2:City {name: 'London'})
RETURN distance(n1.location, n2.location)
结果:
distance(n1.location, n2.location) |
---|
5571177.78487926 |
point()
将代表经纬度的两个数字组合成点坐标。可使用point()
函数指定point类型属性值。
语法 | point({latitude: <lati>, longitude: <longti>}) |
||
参数 | 名称 | 类型 | 描述 |
<lati> |
数值 | 纬度值 | |
<longti> |
数值 | 经度值 | |
返回类型 | POINT |
RETURN point({latitude:39.9, longitude:116.3}) AS point
结果:
point |
---|
POINT(39.9 116.3) |