diamonds
This commit is contained in:
14
cmd/run.go
14
cmd/run.go
@@ -18,8 +18,8 @@ func Run(ctx context.Context) error {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
radius := *area / convertToMiles
|
radius := *area / convertToMiles
|
||||||
radiusX := radius / 2
|
radiusX := 2 * radius / 2
|
||||||
radiusY := radius / 3
|
radiusY := 2 * radius / 3
|
||||||
|
|
||||||
m, err := NewMapsOf(ctx, fs.Args()[0])
|
m, err := NewMapsOf(ctx, fs.Args()[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -51,11 +51,11 @@ func Run(ctx context.Context) error {
|
|||||||
geoJsons[i].Geometry.Type = "Polygon"
|
geoJsons[i].Geometry.Type = "Polygon"
|
||||||
x, y := results[i].Lng, results[i].Lat
|
x, y := results[i].Lng, results[i].Lat
|
||||||
geoJsons[i].Geometry.Coordinates = []any{[]any{
|
geoJsons[i].Geometry.Coordinates = []any{[]any{
|
||||||
[2]float64{x - radiusX, y + radiusY}, // top left
|
[2]float64{x, y + radiusY}, // top
|
||||||
[2]float64{x + radiusX, y + radiusY}, // top righ
|
[2]float64{x + radiusX, y}, // right
|
||||||
[2]float64{x + radiusX, y - radiusY}, // bot righ
|
[2]float64{x, y - radiusY}, // bot
|
||||||
[2]float64{x - radiusX, y - radiusY}, // bot left
|
[2]float64{x - radiusX, y}, // left
|
||||||
[2]float64{x - radiusX, y + radiusY}, // top left
|
[2]float64{x, y + radiusY}, // top
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user