Versions in this module Expand all Collapse all v0 v0.2.0 Aug 15, 2026 v0.1.0 Aug 14, 2026 Changes in this version + const UnknownSRID + var ErrShortEWKB = errors.New("postgis: the geometry data ends in the middle of a value") + func Collect[E any](g GeomExpr[E]) orm.Agg[E, *Geometry] + func DimConst(d Dim) string + func Extent3D[E any](g GeomExpr[E]) orm.Agg[E, *Box3D] + func Extent[E any](g GeomExpr[E]) orm.Agg[E, *Box2D] + func KindConst(k Kind) string + func Register(ctx context.Context, conn *pgx.Conn) error + func RegisterIfPresent(ctx context.Context, conn *pgx.Conn) (bool, error) + func UnionAgg[E any](g GeomExpr[E]) orm.Agg[E, *Geometry] + type Box2D struct + MaxX float64 + MaxY float64 + MinX float64 + MinY float64 + Valid bool + func (b Box2D) Geometry(srid int32) Geometry + func (b Box2D) Height() float64 + func (b Box2D) String() string + func (b Box2D) Width() float64 + type Box3D struct + MaxX float64 + MaxY float64 + MaxZ float64 + MinX float64 + MinY float64 + MinZ float64 + Valid bool + func (b Box3D) String() string + type Coord struct + M float64 + X float64 + Y float64 + Z float64 + type Dim uint8 + const XY + const XYM + const XYZ + const XYZM + func (d Dim) HasM() bool + func (d Dim) HasZ() bool + func (d Dim) String() string + type Family uint8 + const FamilyGeography + const FamilyGeometry + const NotSpatial + func (f Family) String() string + type GeogCol struct + func NewGeogCol[E any](src *orm.Source, name string, srid int32, kind Kind, dim Dim) GeogCol[E] + func (c GeogCol[E]) Area() orm.Value[E, float64] + func (c GeogCol[E]) Dim() Dim + func (c GeogCol[E]) Expr() GeogExpr[E] + func (c GeogCol[E]) Kind() Kind + func (c GeogCol[E]) Length() orm.Value[E, float64] + func (c GeogCol[E]) SRID() int32 + func (c GeogCol[E]) TypeMod() TypeMod + type GeogExpr struct + func ComposeGeog[E any](g GeogExpr[E]) GeogExpr[orm.Composed] + func GeogFromExprNull[E any](v orm.Optional[E, *Geography], mod TypeMod) GeogExpr[E] + func GeogFromExpr[E any](v orm.Selectable[E, Geography], mod TypeMod) GeogExpr[E] + func GeogFromText[E any](wkt string) GeogExpr[E] + func GeogValue[E any](g Geography) GeogExpr[E] + func OfGeog[E any](c interface{ ... }) GeogExpr[orm.Composed] + func (g GeogExpr[E]) Area() orm.Value[E, float64] + func (g GeogExpr[E]) AreaNull() orm.Value[E, *float64] + func (g GeogExpr[E]) AsEWKT() orm.Value[E, string] + func (g GeogExpr[E]) AsGeoJSON() orm.Value[E, string] + func (g GeogExpr[E]) AsGeoJSONNull() orm.Value[E, *string] + func (g GeogExpr[E]) AsGeometry() GeomExpr[E] + func (g GeogExpr[E]) AsText() orm.Value[E, string] + func (g GeogExpr[E]) AsTextNull() orm.Value[E, *string] + func (g GeogExpr[E]) BBoxIntersects(other GeogExpr[E]) orm.Predicate[E] + func (g GeogExpr[E]) BufferMetres(metres float64) GeogExpr[E] + func (g GeogExpr[E]) CoveredBy(other GeogExpr[E]) orm.Predicate[E] + func (g GeogExpr[E]) Covers(other GeogExpr[E]) orm.Predicate[E] + func (g GeogExpr[E]) DWithin(other GeogExpr[E], metres float64) orm.Predicate[E] + func (g GeogExpr[E]) DeclaredSRID() int32 + func (g GeogExpr[E]) Distance(other GeogExpr[E]) orm.Value[E, float64] + func (g GeogExpr[E]) DistanceNull(other GeogExpr[E]) orm.Value[E, *float64] + func (g GeogExpr[E]) Intersects(other GeogExpr[E]) orm.Predicate[E] + func (g GeogExpr[E]) KNNDistance(other GeogExpr[E]) orm.Value[E, float64] + func (g GeogExpr[E]) Length() orm.Value[E, float64] + func (g GeogExpr[E]) LengthNull() orm.Value[E, *float64] + func (g GeogExpr[E]) Nullable() bool + func (g GeogExpr[E]) Perimeter() orm.Value[E, float64] + func (g GeogExpr[E]) SRID() orm.Value[E, int32] + func (g GeogExpr[E]) Value() orm.Value[E, Geography] + func (g GeogExpr[E]) ValueNull() orm.Value[E, *Geography] + type Geography struct + func GeographyPoint(lon, lat float64) Geography + func NewGeography(g Geometry) (Geography, error) + func (g Geography) AppendEWKB(dst []byte) []byte + func (g Geography) AsGeometry() Geometry + func (g Geography) Coords() []Coord + func (g Geography) Dim() Dim + func (g Geography) EWKB() []byte + func (g Geography) Equal(other Geography) bool + func (g Geography) Geometries() []Geometry + func (g Geography) IsEmpty() bool + func (g Geography) Kind() Kind + func (g Geography) NumPoints() int + func (g Geography) SRID() int32 + func (g Geography) String() string + type GeomCol struct + func NewGeomCol[E any](src *orm.Source, name string, srid int32, kind Kind, dim Dim) GeomCol[E] + func (c GeomCol[E]) Area() orm.Value[E, float64] + func (c GeomCol[E]) Dim() Dim + func (c GeomCol[E]) Expr() GeomExpr[E] + func (c GeomCol[E]) Kind() Kind + func (c GeomCol[E]) Length() orm.Value[E, float64] + func (c GeomCol[E]) SRID() int32 + func (c GeomCol[E]) TypeMod() TypeMod + type GeomExpr struct + func Compose[E any](g GeomExpr[E]) GeomExpr[orm.Composed] + func FromExprNull[E any](v orm.Optional[E, *Geometry], mod TypeMod) GeomExpr[E] + func FromExpr[E any](v orm.Selectable[E, Geometry], mod TypeMod) GeomExpr[E] + func GeomFromEWKB[E any](ewkb []byte) GeomExpr[E] + func GeomFromGeoJSONExpr[E any](doc orm.Selectable[E, string]) GeomExpr[E] + func GeomFromGeoJSON[E any](doc string) GeomExpr[E] + func GeomFromTextExpr[E any](wkt orm.Selectable[E, string], srid int32) GeomExpr[E] + func GeomFromText[E any](wkt string, srid int32) GeomExpr[E] + func MakeEnvelope[E any](minX, minY, maxX, maxY float64, srid int32) GeomExpr[E] + func MakePointM[E any](x, y, m orm.Selectable[E, float64]) GeomExpr[E] + func MakePointZ[E any](x, y, z orm.Selectable[E, float64]) GeomExpr[E] + func MakePoint[E any](x, y orm.Selectable[E, float64]) GeomExpr[E] + func Of[E any](c interface{ ... }) GeomExpr[orm.Composed] + func Value[E any](g Geometry) GeomExpr[E] + func (g GeomExpr[E]) Area() orm.Value[E, float64] + func (g GeomExpr[E]) AreaNull() orm.Value[E, *float64] + func (g GeomExpr[E]) AsBinary() orm.Value[E, []byte] + func (g GeomExpr[E]) AsBinaryNull() orm.Value[E, *[]byte] + func (g GeomExpr[E]) AsEWKB() orm.Value[E, []byte] + func (g GeomExpr[E]) AsEWKBNull() orm.Value[E, *[]byte] + func (g GeomExpr[E]) AsEWKT() orm.Value[E, string] + func (g GeomExpr[E]) AsEWKTNull() orm.Value[E, *string] + func (g GeomExpr[E]) AsGeoJSON() orm.Value[E, string] + func (g GeomExpr[E]) AsGeoJSONNull() orm.Value[E, *string] + func (g GeomExpr[E]) AsGeography() GeogExpr[E] + func (g GeomExpr[E]) AsText() orm.Value[E, string] + func (g GeomExpr[E]) AsTextNull() orm.Value[E, *string] + func (g GeomExpr[E]) Azimuth(other GeomExpr[E]) orm.Value[E, *float64] + func (g GeomExpr[E]) BBoxContains(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) BBoxDistance(other GeomExpr[E]) orm.Value[E, float64] + func (g GeomExpr[E]) BBoxIntersects(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) BBoxSame(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) BBoxWithin(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) Boundary() GeomExpr[E] + func (g GeomExpr[E]) Buffer(distance float64) GeomExpr[E] + func (g GeomExpr[E]) Centroid() GeomExpr[E] + func (g GeomExpr[E]) CollectionExtract(k Kind) GeomExpr[E] + func (g GeomExpr[E]) Contains(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) ContainsProperly(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) ConvexHull() GeomExpr[E] + func (g GeomExpr[E]) CoordDim() orm.Value[E, int16] + func (g GeomExpr[E]) CoveredBy(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) Covers(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) Crosses(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) DFullyWithin(other GeomExpr[E], distance float64) orm.Predicate[E] + func (g GeomExpr[E]) DWithin(other GeomExpr[E], distance float64) orm.Predicate[E] + func (g GeomExpr[E]) DeclaredDim() Dim + func (g GeomExpr[E]) DeclaredKind() Kind + func (g GeomExpr[E]) DeclaredSRID() int32 + func (g GeomExpr[E]) Difference(other GeomExpr[E]) GeomExpr[E] + func (g GeomExpr[E]) Dimension() orm.Value[E, int32] + func (g GeomExpr[E]) Disjoint(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) Distance(other GeomExpr[E]) orm.Value[E, float64] + func (g GeomExpr[E]) DistanceNull(other GeomExpr[E]) orm.Value[E, *float64] + func (g GeomExpr[E]) Envelope() GeomExpr[E] + func (g GeomExpr[E]) EqualsGeom(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) Force2D() GeomExpr[E] + func (g GeomExpr[E]) Force3D() GeomExpr[E] + func (g GeomExpr[E]) GeometryType() orm.Value[E, string] + func (g GeomExpr[E]) Intersection(other GeomExpr[E]) GeomExpr[E] + func (g GeomExpr[E]) Intersects(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) IsEmptyGeom() orm.Predicate[E] + func (g GeomExpr[E]) IsSimple() orm.Predicate[E] + func (g GeomExpr[E]) IsValid() orm.Predicate[E] + func (g GeomExpr[E]) IsValidReason() orm.Value[E, string] + func (g GeomExpr[E]) IsValidReasonNull() orm.Value[E, *string] + func (g GeomExpr[E]) KNNDistance(other GeomExpr[E]) orm.Value[E, float64] + func (g GeomExpr[E]) Length() orm.Value[E, float64] + func (g GeomExpr[E]) LengthNull() orm.Value[E, *float64] + func (g GeomExpr[E]) M() orm.Value[E, *float64] + func (g GeomExpr[E]) MakeValid() GeomExpr[E] + func (g GeomExpr[E]) MaxDistance(other GeomExpr[E]) orm.Value[E, float64] + func (g GeomExpr[E]) Multi() GeomExpr[E] + func (g GeomExpr[E]) Nullable() bool + func (g GeomExpr[E]) NumGeometries() orm.Value[E, int32] + func (g GeomExpr[E]) NumPoints() orm.Value[E, int32] + func (g GeomExpr[E]) Overlaps(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) Perimeter() orm.Value[E, float64] + func (g GeomExpr[E]) PerimeterNull() orm.Value[E, *float64] + func (g GeomExpr[E]) PointOnSurface() GeomExpr[E] + func (g GeomExpr[E]) Relate(other GeomExpr[E], pattern string) orm.Predicate[E] + func (g GeomExpr[E]) SRID() orm.Value[E, int32] + func (g GeomExpr[E]) SetSRID(srid int32) GeomExpr[E] + func (g GeomExpr[E]) Simplify(tolerance float64) GeomExpr[E] + func (g GeomExpr[E]) SimplifyPreserveTopology(tolerance float64) GeomExpr[E] + func (g GeomExpr[E]) SymDifference(other GeomExpr[E]) GeomExpr[E] + func (g GeomExpr[E]) Touches(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) Transform(srid int32) GeomExpr[E] + func (g GeomExpr[E]) Union(other GeomExpr[E]) GeomExpr[E] + func (g GeomExpr[E]) Value() orm.Value[E, Geometry] + func (g GeomExpr[E]) ValueNull() orm.Value[E, *Geometry] + func (g GeomExpr[E]) Within(other GeomExpr[E]) orm.Predicate[E] + func (g GeomExpr[E]) X() orm.Value[E, *float64] + func (g GeomExpr[E]) Y() orm.Value[E, *float64] + func (g GeomExpr[E]) Z() orm.Value[E, *float64] + type Geometry struct + func DecodeEWKB(b []byte) (Geometry, error) + func EmptyPoint(srid int32) Geometry + func NewCollection(srid int32, members ...Geometry) (Geometry, error) + func NewLineString(srid int32, dim Dim, cs ...Coord) Geometry + func NewMultiLineString(srid int32, dim Dim, lines ...[]Coord) Geometry + func NewMultiPoint(srid int32, dim Dim, cs ...Coord) Geometry + func NewMultiPolygon(srid int32, dim Dim, polygons ...[][]Coord) Geometry + func NewPoint(srid int32, x, y float64) Geometry + func NewPointM(srid int32, x, y, m float64) Geometry + func NewPointZ(srid int32, x, y, z float64) Geometry + func NewPointZM(srid int32, x, y, z, m float64) Geometry + func NewPolygon(srid int32, dim Dim, rings ...[]Coord) Geometry + func (g Geometry) AppendEWKB(dst []byte) []byte + func (g Geometry) AsGeography() (Geography, error) + func (g Geometry) Coords() []Coord + func (g Geometry) Dim() Dim + func (g Geometry) EWKB() []byte + func (g Geometry) Equal(other Geometry) bool + func (g Geometry) Geometries() []Geometry + func (g Geometry) IsEmpty() bool + func (g Geometry) Kind() Kind + func (g Geometry) NumPoints() int + func (g Geometry) SRID() int32 + func (g Geometry) String() string + func (g Geometry) WithSRID(srid int32) Geometry + type Kind uint8 + const AnyKind + const KindCollection + const KindLineString + const KindMultiLineString + const KindMultiPoint + const KindMultiPolygon + const KindPoint + const KindPolygon + func (k Kind) String() string + type NotInstalledError struct + func (*NotInstalledError) Error() string + type NullGeogCol struct + func NewNullGeogCol[E any](src *orm.Source, name string, srid int32, kind Kind, dim Dim) NullGeogCol[E] + func (c NullGeogCol[E]) Area() orm.Value[E, *float64] + func (c NullGeogCol[E]) Dim() Dim + func (c NullGeogCol[E]) Expr() GeogExpr[E] + func (c NullGeogCol[E]) Kind() Kind + func (c NullGeogCol[E]) Length() orm.Value[E, *float64] + func (c NullGeogCol[E]) SRID() int32 + func (c NullGeogCol[E]) TypeMod() TypeMod + type NullGeomCol struct + func NewNullGeomCol[E any](src *orm.Source, name string, srid int32, kind Kind, dim Dim) NullGeomCol[E] + func (c NullGeomCol[E]) Area() orm.Value[E, *float64] + func (c NullGeomCol[E]) Dim() Dim + func (c NullGeomCol[E]) Expr() GeomExpr[E] + func (c NullGeomCol[E]) Kind() Kind + func (c NullGeomCol[E]) Length() orm.Value[E, *float64] + func (c NullGeomCol[E]) SRID() int32 + func (c NullGeomCol[E]) TypeMod() TypeMod + type TypeMod struct + Dim Dim + Family Family + Kind Kind + SRID int32 + func ParseTypeMod(declared string) (TypeMod, error) + func (m TypeMod) Accepts(g Geometry) error + func (m TypeMod) Constrained() bool + func (m TypeMod) GoType() string + func (m TypeMod) Spatial() bool + func (m TypeMod) String() string