From 5a8feec56b71413418c86eaf425f852ffa73ba5a Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 29 Apr 2019 18:43:30 +0100 Subject: [PATCH] Ensure polygons are created correctly --- util/fncs/geo.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/fncs/geo.go b/util/fncs/geo.go index 7fa564c9..170ac761 100644 --- a/util/fncs/geo.go +++ b/util/fncs/geo.go @@ -64,6 +64,8 @@ func geoPolygon(ctx context.Context, args ...interface{}) (interface{}, error) { for _, a := range args { if p, _ := ensurePoint(a); p != nil { pnts = append(pnts, p) + } else if p := ensureFloats(a); len(p) == 2 { + pnts = append(pnts, sql.NewPoint(p[0], p[1])) } else { return nil, nil }