ot-browser/cmd/ot-browser/geojson.go

23 lines
568 B
Go

package main
type GeoJSON struct {
Type string `json:"type"`
Geometry Geometry `json:"geometry"`
Properties map[string]string `json:"properties"`
}
type Geometry struct {
Type string `json:"type"`
Coordinates [2]float32 `json:"coordinates"`
}
func CreatePoint(lon float32, lat float32) GeoJSON {
var geojson GeoJSON
geojson.Type = "Feature"
geojson.Properties = make(map[string]string, 0)
geojson.Geometry.Type = "Point"
geojson.Geometry.Coordinates[0] = lon
geojson.Geometry.Coordinates[1] = lat
return geojson
}