POINT and POINT3D values carry a coordinate reference system (CRS), identified by an integer SRID. Four CRSs are supported:
| SRID | CRS name | Dimensions | Distance |
|---|---|---|---|
4326 | wgs-84 | 2D (longitude, latitude) | Great-circle (haversine), meters |
4979 | wgs-84-3d | 3D (longitude, latitude, height) | Haversine + height, meters |
7203 | cartesian | 2D (x, y) | Euclidean, raw coordinate units |
9157 | cartesian-3d | 3D (x, y, z) | Euclidean, raw coordinate units |
The CRS determines how distance() is computed. Two points must share the same CRS to be compared.

GQLINSERT (paris:City {name: "Paris", location: point(2.4, 48.9), landmark: point3d(100, 25.3, 652.1)}), (newYork:City {name: "New York", location: point(-74.0, 40.7), landmark: point3d(95, 23, 54)}), (london:City {name: "London", location: point(-0.13, 51.5), landmark: point3d(5.2, 66, 3.2)}), (newYork)-[:Connects]->(paris), (newYork)-[:Connects]->(london), (paris)-[:Connects]->(london)
Creates a POINT (2D) or POINT3D (3D when a z/altitude/height key is present in the map form) value.
| Syntax | point(<longitude>, <latitude>) or point(<map>) | ||
| Arguments | Form | Behavior | CRS |
Positional (longitude, latitude) | Two numeric arguments. | Always wgs-84 (SRID 4326). | |
Map ({...}) | Single map literal with coordinate keys (and optional crs/srid). | Inferred from keys; overridable. | |
| Return Type | POINT, or POINT3D when the map carries a third coordinate. | ||
Map form rules:
x / longitude / lngy / latitude / latPOINT3D): z / altitude / heightcrs nor srid is given):
longitude/latitude/lng/lat/height) → wgs-84 (or wgs-84-3d if 3D).cartesian (or cartesian-3d if 3D).crs: '<name>' or srid: <number>. CRS must match the dimensionality of the coordinates.GQL-- Positional: WGS-84 by default RETURN point(116.3, 39.9) -- Map form, WGS-84 inferred from key names RETURN point({longitude: 116.3, latitude: 39.9}) -- Map form, cartesian inferred from x/y RETURN point({x: 1.5, y: 2.5}) -- Map form with z promotes to POINT3D (cartesian-3d) RETURN point({x: 1, y: 2, z: 3}) -- Map form with height promotes to POINT3D (wgs-84-3d) RETURN point({longitude: 116.3, latitude: 39.9, height: 100}) -- Explicit CRS override RETURN point({x: 1.5, y: 2.5, crs: 'wgs-84'}) RETURN point({x: 1.5, y: 2.5, srid: 4326})
Creates a POINT3D value. Same map-form rules as point(); the map argument must include the third coordinate.
| Syntax | point3d(<x>, <y>, <z>) or point3d(<map>) | ||
| Arguments | Form | Behavior | CRS |
Positional (x, y, z) | Three numeric arguments. | Always cartesian-3d (SRID 9157). | |
Map ({...}) | Single map literal with three coordinate keys (and optional crs/srid). | Inferred from keys; overridable. | |
| Return Type | POINT3D | ||
GQL-- Positional: cartesian-3d by default RETURN point3d(10, 15, 5) -- Map form, cartesian-3d inferred from x/y/z RETURN point3d({x: 10, y: 15, z: 5}) -- Map form, wgs-84-3d inferred from longitude/latitude/height RETURN point3d({longitude: 116.3, latitude: 39.9, height: 100}) -- Explicit CRS override RETURN point3d({x: 1, y: 2, z: 3, crs: 'wgs-84-3d'})
Computes the distance between two points. The formula is chosen by the CRS the points carry (not by Go type):
wgs-84, wgs-84-3d) — great-circle (haversine) distance in meters. The 3D form adds the height difference (Pythagoras).cartesian, cartesian-3d) — Euclidean distance in the raw coordinate units.Both points must share the same CRS, otherwise the call errors.
| Syntax | distance(<point1>, <point2>) | ||
| Arguments | Name | Type | Description |
<point1> | POINT or POINT3D | The first point | |
<point2> | POINT or POINT3D | The second point; must be the same type as <point1> | |
| Return Type | DOUBLE | ||
GQLMATCH (n1:City {name: 'New York'}) MATCH (n2:City {name: 'London'}) RETURN distance(n1.location, n2.location)
Result: 5570833.653336142 (meters)
Extracts a coordinate value from a POINT or POINT3D value by index.
| Syntax | point_get(<point>, <index>) | ||
| Arguments | Name | Type | Description |
<point> | POINT or POINT3D | A point value | |
<index> | INT | Coordinate index. For POINT: 0 = longitude, 1 = latitude. For POINT3D: 0 = x, 1 = y, 2 = z. | |
| Return Type | DOUBLE | ||
GQLMATCH (n {name: "New York"}) RETURN point_get(n.location, 0) AS longitude, point_get(n.location, 1) AS latitude
Result:
| longitude | latitude |
|---|---|
| -74.0 | 40.7 |