Ensure polygons are created correctly

This commit is contained in:
Tobie Morgan Hitchcock 2019-04-29 18:43:30 +01:00
parent 09c32c2d64
commit 5a8feec56b

View file

@ -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
}