pgxorb 
Package pgxorb provides PostGIS support for github.com/jackc/pgx/v5 via github.com/paulmach/orb..
Usage
Single connection
import (
// ...
"github.com/jackc/pgx/v5"
"github.com/moeryomenko/pgxorb"
"github.com/paulmach/orb"
)
// ...
connectionStr := os.Getenv("DATABASE_URL")
conn, err := pgx.Connect(context.Background(), connectionStr)
if err != nil {
return err
}
if err := pgxorb.Register(ctx, conn); err != nil {
return err
}
Connection pool
import (
// ...
"github.com/jackc/pgx/v5/pgxpool"
)
// ...
config, err := pgxpool.ParseConfig(connectionStr)
if err != nil {
return err
}
config.AfterConnect = func(ctx context.Context, conn *pgx.Conn) error {
if err := pgxorb.Register(ctx, conn); err != nil {
return err
}
return nil
}
pool, err := pgxpool.NewWithConfig(context.Background(), config)
if err != nil {
return err
}
License
pgxorb is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and/or LICENSE-MIT for details.