kml

package module
v0.0.0-...-3324e79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2022 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AltitudeMode = [...]string{
	"clampToGround",
	"relativeToGround",
	"absolute",
	"clampToSeaFloor",
	"relativeToSeaFloor",
}

Functions

func NewCoordinates

func NewCoordinates(longitude, latitude, altitude float64) string

func NewCoordinatesOffset

func NewCoordinatesOffset(longitude, latitude float64) string

Types

type AltitudeModeKey

type AltitudeModeKey int
const (
	ClampToGround AltitudeModeKey = iota
	RelativeToGround
	Absolute
	ClampToSeaFloor
	RelativeToSeaFloor
)

type Description

type Description struct {
	Data string `xml:",cdata"`
}

type DocKml

type DocKml struct {
	Kml       *Kml
	IconsPath []string
	Kmlname   string
}

func NewDocKml

func NewDocKml(kmlname string) *DocKml

func (*DocKml) Save

func (k *DocKml) Save(filename string) error

type Document

type Document struct {
	Name    string   `xml:"name"`
	Styles  []Style  `xml:"Style"`
	Folders []Folder `xml:"Folder"`
}

type Folder

type Folder struct {
	Name       string      `xml:"name"`
	Placemarks []Placemark `xml:"Placemark"`
	Open       int         `xml:"open"`
}

func NewFolder

func NewFolder(name string) Folder

func (*Folder) AddPlacemark

func (f *Folder) AddPlacemark(placemark Placemark)

type Icon

type Icon struct {
	Href string `xml:"href,omitempty"`
}

type IconStyle

type IconStyle struct {
	Id    string  `xml:"id,attr,omitempty"`
	Icon  Icon    `xml:"Icon,omitempty"`
	Color string  `xml:"color,omitempty"`
	Scale float64 `xml:"scale,omitempty"`
}

type Kml

type Kml struct {
	XMLName       xml.Name `xml:"kml"`
	Namespace     string   `xml:"xmlns,attr"`
	AtomNamespace string   `xml:"xmlns:atom,attr"`
	GxNamespace   string   `xml:"xmlns:gx,attr"`
	KmlNamespace  string   `xml:"xmlns:kml,attr"`
	Document      Document `xml:"Document"`
}

Kml template

func NewKML

func NewKML(namespace string, numPlacemarks int) *Kml

func (*Kml) AddFolder

func (k *Kml) AddFolder(folder Folder)

func (*Kml) Marshal

func (k *Kml) Marshal() ([]byte, error)

type LabelStyle

type LabelStyle struct {
	Color string  `xml:"color,omitempty"`
	Scale float64 `xml:"scale,omitempty"`
}

type LineString

type LineString struct {
	Extrude      int    `xml:"extrude"`
	AltitudeMode string `xml:"altitudeMode"`
	Coordinates  string `xml:"coordinates"`
	Tessellate   int    `xml:"tessellate"`
}

linestring google template

func (*LineString) AddCoordinate

func (l *LineString) AddCoordinate(longitude float64, latitude float64, altitude float64)

type LineStyle

type LineStyle struct {
	Color string `xml:"color,omitempty"`
	Width int    `xml:"width,omitempty"`
}

type Placemark

type Placemark struct {
	Name        string        `xml:"name"`
	Description Description   `xml:"description"`
	StyleUrl    string        `xml:"styleUrl"`
	Style       *Style        `xml:"Style,omitempty"`
	Point       Point         `xml:"Point,omitempty"`
	LineString  []*LineString `xml:"LineString,omitempty"`
}

Placemark template

func (*Placemark) AddLineString

func (p *Placemark) AddLineString(lineString LineString)

func (*Placemark) AppendContent

func (p *Placemark) AppendContent(content string)

type Point

type Point struct {
	AltitudeMode string `xml:"altitudeMode,omitempty"`
	Coordinates  string `xml:"coordinates"`
}

type Style

type Style struct {
	Id         string     `xml:"id,attr,omitempty"`
	IconStyle  IconStyle  `xml:"IconStyle,omitempty"`
	LabelStyle LabelStyle `xml:"LabelStyle,omitempty"`
	LineStyle  LineStyle  `xml:"LineStyle,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL