mise cool

This commit is contained in:
bel
2026-03-08 23:55:40 -06:00
parent 4c5d4e805c
commit 2662e056e0
2 changed files with 29 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"os"
"path"
)
func Run(ctx context.Context) error {
@@ -18,7 +19,27 @@ func Run(ctx context.Context) error {
return err
}
b, _ := json.Marshal(results)
type geoJson struct {
Type string `json:"type"`
Properties struct {
Name string `json:"name"`
} `json:"properties"`
Geometry struct {
Type string `json:"type"`
Coordinates []float64 `json:"coordinates"`
} `json:"geometry"`
}
geoJsons := make([]geoJson, len(results))
for i := range results {
geoJsons[i].Type = "Feature"
geoJsons[i].Properties.Name = path.Join(os.Args[2], results[i].Name)
geoJsons[i].Geometry.Type = "Point"
geoJsons[i].Geometry.Coordinates = []float64{results[i].Lng, results[i].Lat}
}
b, _ := json.Marshal(map[string]any{
"features": geoJsons,
"type": "FeatureCollection",
})
fmt.Printf("%s\n", b)
return ctx.Err()