nidus-sync/geomutil/geomutil.go
Eli Ribble 7a361a330d
Remove now-extraneous latitude/longitude generated columns
Now that we can pull out the geometry directly into a go object we don't
need these and they complicate our insertions
2026-05-07 16:38:42 +00:00

20 lines
392 B
Go

package geomutil
import (
"errors"
"github.com/twpayne/go-geom"
)
func AsPoint(g geom.T) (geom.Point, error) {
p, ok := g.(*geom.Point)
if !ok {
return geom.Point{}, errors.New("not a point")
}
if p == nil {
return geom.Point{}, errors.New("nil point")
}
return *p, nil
}
func PointFromLngLat(lng, lat float64) geom.T {
return geom.NewPointFlat(geom.XY, []float64{lng, lat})
}