diff --git a/controller/crud.go b/controller/crud.go index 32e7a40d..d99f390b 100644 --- a/controller/crud.go +++ b/controller/crud.go @@ -463,12 +463,12 @@ func (c *Controller) parseSetArgs(vs []resp.Value) (d commandDetailsT, fields [] } g := geojson.Polygon{ Coordinates: [][]geojson.Position{ - []geojson.Position{ - geojson.Position{X: minlon, Y: minlat, Z: 0}, - geojson.Position{X: minlon, Y: maxlat, Z: 0}, - geojson.Position{X: maxlon, Y: maxlat, Z: 0}, - geojson.Position{X: maxlon, Y: minlat, Z: 0}, - geojson.Position{X: minlon, Y: minlat, Z: 0}, + { + {X: minlon, Y: minlat, Z: 0}, + {X: minlon, Y: maxlat, Z: 0}, + {X: maxlon, Y: maxlat, Z: 0}, + {X: maxlon, Y: minlat, Z: 0}, + {X: minlon, Y: minlat, Z: 0}, }, }, } diff --git a/geojson/bbox.go b/geojson/bbox.go index b4cd22ed..e14fb0de 100644 --- a/geojson/bbox.go +++ b/geojson/bbox.go @@ -117,11 +117,11 @@ func (b BBox) union(bbox BBox) BBox { func (b BBox) exterior() []Position { return []Position{ - Position{b.Min.X, b.Min.Y, 0}, - Position{b.Min.X, b.Max.Y, 0}, - Position{b.Max.X, b.Max.Y, 0}, - Position{b.Max.X, b.Min.Y, 0}, - Position{b.Min.X, b.Min.Y, 0}, + {b.Min.X, b.Min.Y, 0}, + {b.Min.X, b.Max.Y, 0}, + {b.Max.X, b.Max.Y, 0}, + {b.Max.X, b.Min.Y, 0}, + {b.Min.X, b.Min.Y, 0}, } } diff --git a/geojson/object_test.go b/geojson/object_test.go index b3b85ff1..f6e9ef66 100644 --- a/geojson/object_test.go +++ b/geojson/object_test.go @@ -17,7 +17,7 @@ func TestCirclePolygon(t *testing.T) { } rect := Polygon{ Coordinates: [][]Position{ - []Position{ + { {X: -120, Y: 20, Z: 0}, {X: -120, Y: 40, Z: 0}, {X: -100, Y: 40, Z: 0}, diff --git a/geojson/poly/intersects_test.go b/geojson/poly/intersects_test.go index 80561c40..9528f26d 100644 --- a/geojson/poly/intersects_test.go +++ b/geojson/poly/intersects_test.go @@ -78,13 +78,13 @@ func TestIntersectsShapes(t *testing.T) { testIntersectsShapes(t, Polygon{P(0, 0), P(0, 6), P(6, 0), P(0, 0)}, - []Polygon{Polygon{P(1, 1), P(1, 2), P(2, 2), P(2, 1), P(1, 1)}}, + []Polygon{{P(1, 1), P(1, 2), P(2, 2), P(2, 1), P(1, 1)}}, Polygon{P(0.5, 0.5), P(0.5, 4.5), P(4.5, 0.5), P(0.5, 0.5)}, true) testIntersectsShapes(t, Polygon{P(0, 0), P(0, 10), P(10, 10), P(10, 0), P(0, 0)}, - []Polygon{Polygon{P(2, 2), P(2, 6), P(6, 6), P(6, 2), P(2, 2)}}, + []Polygon{{P(2, 2), P(2, 6), P(6, 6), P(6, 2), P(2, 2)}}, Polygon{P(1, 1), P(1, 9), P(9, 9), P(9, 1), P(1, 1)}, true) }