Go KML Writer is a powerful Go (Golang) package designed to simplify the creation of KML (Keyhole Markup Language) files. KML is a popular XML-based format used to represent geographical data and is widely supported by mapping and Geographic Information System (GIS) software.
Create KML documents such as:
- Placemarks
Notes: Other KML documents will be added in the next release
Install packages
go get github.com/elpahlevi/go-kml-writer
Follow the examples in the "Usage Example" section or go to kml_test.go
file for more.
package main
import (
"github.com/elpahlevi/go-kml-writer"
)
func main() {
kml := kml.New()
pm := placemark.New()
pm.AddCoordinates("113.97395", "-2.99994", "0")
pm.AddExtendedData("acqdatetimetz", "2023-10-18 09:09:00")
pm.AddExtendedData("confidence", "80")
kml.AddToDocument(pm)
marshaled, err := kml.MarshalIndent("", " ")
if err != nil {
panic(err)
}
kml.WriteOutput(marshaled, "./output/output.kml")
}
Copyright (c) 2023-present Reza Pahlevi. Go KML Writer
is open-source and licensed under the MIT License.