Example Graph
The following examples run against this graph:

distance()
Computes the straight-line distance between two points.
Syntax | distance(<point1>, <point2>) |
||
Arguments | Name | Type | Description |
<point1> |
POINT |
The first point | |
<point2> |
POINT |
The second point | |
Return Type | DOUBLE |
MATCH (n1:City {name: 'New York'})
MATCH (n2:City {name: 'London'})
RETURN distance(n1.location, n2.location)
Result:
distance(n1.location, n2.location) |
---|
5571177.78487926 |
point()
Combines two numbers representing latitude and longitude into a point. The point()
function can be used to specify the value of a point-type property.
Syntax | point({latitude: <lati>, longitude: <longti>}) |
||
Arguments | Name | Type | Description |
<lati> |
Numeric | The latitude value | |
<longti> |
Numeric | The longitude value | |
Return Type | POINT |
RETURN point({latitude:39.9, longitude:116.3}) AS point
Result:
point |
---|
POINT(39.9 116.3) |