Documentation
¶
Index ¶
- func D(d, m, s float64) float64
- func Read(rs io.ReadSeeker) (Collection, Format, error)
- func Write(w io.Writer, wc Collection, format string) error
- type Collection
- type CompeGPSFormat
- type Format
- type FormatGeoFormat
- type GeoJSONFormat
- type GeoJSONWaypoint
- type GeoJSONWaypointFeatureCollection
- type OziExplorerFormat
- type SeeYouFormat
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
func Read(rs io.ReadSeeker) (Collection, Format, error)
Read tries to read waypoints from rs using all known formats. When successful, it returns the waypoints and the original format.
Types ¶
type Collection ¶
type Collection []*T
A Collection is a collection of Ts.
func (Collection) MarshalJSON ¶
func (wc Collection) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding/json.Marshaler.
type CompeGPSFormat ¶
type CompeGPSFormat struct{}
A CompeGPSFormat represents a CompeGPS format.
func NewCompeGPSFormat ¶
func NewCompeGPSFormat() *CompeGPSFormat
NewCompeGPSFormat returns a new CompeGPSFormat.
func (*CompeGPSFormat) Extension ¶
func (*CompeGPSFormat) Extension() string
Extension returns the CompeGPS format extension.
func (*CompeGPSFormat) Name ¶
func (*CompeGPSFormat) Name() string
Name returns the CompeGPS format name.
func (*CompeGPSFormat) Read ¶
func (*CompeGPSFormat) Read(r io.Reader) (Collection, error)
Read reads waypoints from r.
func (*CompeGPSFormat) Write ¶
func (*CompeGPSFormat) Write(w io.Writer, wc Collection) error
Write writes wc to w.
type Format ¶
type Format interface { Extension() string Name() string Read(io.Reader) (Collection, error) Write(io.Writer, Collection) error }
A Format is a waypoint format, with metadata and methods to read and write.
type FormatGeoFormat ¶
type FormatGeoFormat struct{}
A FormatGeoFormat is a GeoFormat format.
func NewFormatGeoFormat ¶
func NewFormatGeoFormat() *FormatGeoFormat
NewFormatGeoFormat returns a new FormatGeoFormat.
func (*FormatGeoFormat) Extension ¶
func (f *FormatGeoFormat) Extension() string
Extension returns f's extension.
func (*FormatGeoFormat) Read ¶
func (f *FormatGeoFormat) Read(r io.Reader) (Collection, error)
Read reads a Collection from r.
func (*FormatGeoFormat) Write ¶
func (f *FormatGeoFormat) Write(w io.Writer, wc Collection) error
Write writes wc to w.
type GeoJSONFormat ¶
type GeoJSONFormat struct{}
A GeoJSONFormat is a GeoJSON format.
func NewGeoJSONFormat ¶
func NewGeoJSONFormat() *GeoJSONFormat
NewGeoJSONFormat returns a new GeoJSONFormat.
func (*GeoJSONFormat) Extension ¶
func (f *GeoJSONFormat) Extension() string
Extension returns f's extension.
func (*GeoJSONFormat) Read ¶
func (f *GeoJSONFormat) Read(r io.Reader) (Collection, error)
Read reads a Collection from r.
func (*GeoJSONFormat) Write ¶
func (f *GeoJSONFormat) Write(w io.Writer, wc Collection) error
Write writes c to w.
type GeoJSONWaypoint ¶
type GeoJSONWaypoint struct { ID string `json:"id"` Type string `json:"type"` Geometry struct { Type string `json:"type"` Coordinates []float64 `json:"coordinates"` } Properties struct { Color string `json:"color"` Description string `json:"description"` Radius float64 `json:"radius"` } }
A GeoJSONWaypoint is a GeoJSON waypoint.
type GeoJSONWaypointFeatureCollection ¶
type GeoJSONWaypointFeatureCollection struct { Type string `json:"type"` Features []GeoJSONWaypoint `json:"features"` }
A GeoJSONWaypointFeatureCollection is a GeoJSON FeatureCollection of GeoJSON waypoints.
type OziExplorerFormat ¶
type OziExplorerFormat struct{}
An OziExplorerFormat is an OziExplorer format.
func NewOziExplorerFormat ¶
func NewOziExplorerFormat() *OziExplorerFormat
NewOziExplorerFormat returns a new OziExplorerFormat.
func (*OziExplorerFormat) Extension ¶
func (f *OziExplorerFormat) Extension() string
Extension returns f's extension.
func (*OziExplorerFormat) Read ¶
func (f *OziExplorerFormat) Read(r io.Reader) (Collection, error)
Read reads a Collection from r.
func (*OziExplorerFormat) Write ¶
func (f *OziExplorerFormat) Write(w io.Writer, wc Collection) error
Write writes wc to w.
type SeeYouFormat ¶
type SeeYouFormat struct{}
A SeeYouFormat is a SeeYou format.
func NewSeeYouFormat ¶
func NewSeeYouFormat() *SeeYouFormat
NewSeeYouFormat returns a new SeeYouFormat.
func (*SeeYouFormat) Extension ¶
func (f *SeeYouFormat) Extension() string
Extension returns f's extension.
func (*SeeYouFormat) Read ¶
func (f *SeeYouFormat) Read(r io.Reader) (Collection, error)
Read reads a Collection from r.
func (*SeeYouFormat) Write ¶
func (*SeeYouFormat) Write(w io.Writer, wc Collection) error
Write writes wc to w.