Skip to content

Go Package to create KML (Keyhole Markup Language) files

License

Notifications You must be signed in to change notification settings

elpahlevi/go-kml-writer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go KML Writer

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.

Features

Create KML documents such as:

  1. Placemarks

Notes: Other KML documents will be added in the next release

Getting Started

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.

Usage Example

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")
}

License

Copyright (c) 2023-present Reza Pahlevi. Go KML Writer is open-source and licensed under the MIT License.

About

Go Package to create KML (Keyhole Markup Language) files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages