Geometry types
The SDK provides typed geometry structs that map to SurrealDB's GeoJSON-based geometry types. Each type handles CBOR encoding with the appropriate tag number.
Package: github.com/surrealdb/surrealdb.go/pkg/models
Source: pkg/models/geometry.go
Types
GeometryPoint
A geographic point with longitude and latitude coordinates.
CBOR tag: 88
Methods
.GetCoordinates()— returns[2]float64{Longitude, Latitude}
Examples
GeometryLine
A line consisting of two or more points.
CBOR tag: 89
GeometryPolygon
A polygon consisting of one or more closed line rings.
CBOR tag: 90
GeometryMultiPoint
A collection of points.
CBOR tag: 91
GeometryMultiLine
A collection of lines.
CBOR tag: 92
GeometryMultiPolygon
A collection of polygons.
CBOR tag: 93
GeometryCollection
A heterogeneous collection of geometry objects.
CBOR tag: 94
Usage
See Also
RecordID for the record identifier type
Value types for the full type mapping
Data manipulation for using geometry values in CRUD operations
SurrealQL geometry types for the underlying data model