func CoordinatesArray(value ...[]float64) *CoordinatesArrayElement {
	return &CoordinatesArrayElement{coordinates: value}
}
CoordinatesArray returns a new CoordinatesArrayElement.
package kml
import (
	"encoding/xml"
	"io"
	"strconv"
)
const Namespace = "http://www.opengis.net/kml/2.2"
var (
	coordinatesStartElement = xml.StartElement{
		Name: xml.Name{
			Local: "coordinates",
		},
	}
	coordinatesEndElement = coordinatesStartElement.End()
)
type Coordinate struct {
	Lon, Lat, Alt float64
}
type Vec2 struct {
	X, Y           float64
	XUnits, YUnits UnitsEnum
}
type CoordinatesElement struct {
	coordinates []Coordinate
}
type CoordinatesArrayElement struct {
	coordinates [][]float64
}
type CoordinatesFlatElement struct {
	flatCoords               []float64
	offset, end, stride, dim int
}
func (ce *CoordinatesElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
	if err := e.EncodeToken(coordinatesStartElement); err != nil {
		return err
	}
	for i, c := range ce.coordinates {
		s := ""
		if i != 0 {
			s = " "
		}
		s += strconv.FormatFloat(c.Lon, 'f', -1, 64) + "," + strconv.FormatFloat(c.Lat, 'f', -1, 64)
		if c.Alt != 0 {
			s += "," + strconv.FormatFloat(c.Alt, 'f', -1, 64)
		}
		if err := e.EncodeToken(xml.CharData([]byte(s))); err != nil {
			return err
		}
	}
	return e.EncodeToken(coordinatesEndElement)
}
func (ce *CoordinatesElement) Write(w io.Writer) error {
	return write(w, "", "  ", ce)
}
func (ce *CoordinatesElement) WriteIndent(w io.Writer, prefix, indent string) error {
	return write(w, prefix, indent, ce)
}
func (cae *CoordinatesArrayElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
	if err := e.EncodeToken(coordinatesStartElement); err != nil {
		return err
	}
	for i, c := range cae.coordinates {
		s := ""
		if i != 0 {
			s = " "
		}
		s += strconv.FormatFloat(c[0], 'f', -1, 64) + "," + strconv.FormatFloat(c[1], 'f', -1, 64)
		if len(c) > 2 && c[2] != 0 {
			s += "," + strconv.FormatFloat(c[2], 'f', -1, 64)
		}
		if err := e.EncodeToken(xml.CharData([]byte(s))); err != nil {
			return err
		}
	}
	return e.EncodeToken(coordinatesEndElement)
}
func (cae *CoordinatesArrayElement) Write(w io.Writer) error {
	return write(w, "", "  ", cae)
}
func (cae *CoordinatesArrayElement) WriteIndent(w io.Writer, prefix, indent string) error {
	return write(w, prefix, indent, cae)
}
func (cfe *CoordinatesFlatElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
	if err := e.EncodeToken(coordinatesStartElement); err != nil {
		return err
	}
	for i := cfe.offset; i < cfe.end; i += cfe.stride {
		s := ""
		if i != cfe.offset {
			s = " "
		}
		s += strconv.FormatFloat(cfe.flatCoords[i], 'f', -1, 64) + "," + strconv.FormatFloat(cfe.flatCoords[i+1], 'f', -1, 64)
		if cfe.dim > 2 && cfe.flatCoords[i+2] != 0 {
			s += "," + strconv.FormatFloat(cfe.flatCoords[i+2], 'f', -1, 64)
		}
		if err := e.EncodeToken(xml.CharData([]byte(s))); err != nil {
			return err
		}
	}
	return e.EncodeToken(coordinatesEndElement)
}
func (cfe *CoordinatesFlatElement) Write(w io.Writer) error {
	return write(w, "", "  ", cfe)
}
func (cfe *CoordinatesFlatElement) WriteIndent(w io.Writer, prefix, indent string) error {
	return write(w, prefix, indent, cfe)
}
func Coordinates(value ...Coordinate) *CoordinatesElement {
	return &CoordinatesElement{coordinates: value}
}