Documentation
¶
Index ¶
Constants ¶
View Source
const CyclingQueryTemplate = `` /* 289-byte string literal not displayed */
View Source
const HikingQueryTemplate = `` /* 981-byte string literal not displayed */
View Source
const PeaksQueryTemplate = `
[out:json][timeout:20];
node["natural"="peak"]({{.MinLat}},{{.MinLon}},{{.MaxLat}},{{.MaxLon}});
out body;`
View Source
const VillagesQueryTemplate = `
[out:json][timeout:20];
node[place~"city|town|village"]({{.MinLat}},{{.MinLon}},{{.MaxLat}},{{.MaxLon}});
out body;`
Variables ¶
View Source
var AllTemplates = map[string]string{ "peaks": PeaksQueryTemplate, "hiking": HikingQueryTemplate, "village": VillagesQueryTemplate, "cycling": CyclingQueryTemplate, }
Functions ¶
Types ¶
type Amenity ¶
type Amenity struct {
ID int64
Name string
Type string
Ele float64
Lat float64
Lon float64
ParentWay *Amenity
}
func FetchAmenities ¶
func FetchAmenities(ctx context.Context, bbox BoundingBox, op FetchOptions) ([]*Amenity, error)
func (*Amenity) GetElevation ¶
type BoundingBox ¶
type FetchOptions ¶
func DefaultFetchOptions ¶
func DefaultFetchOptions() FetchOptions
type FindOptions ¶
func DefaultFindOptions ¶
func DefaultFindOptions() FindOptions
type OverpassResponse ¶
type OverpassResponse struct {
Elements []struct {
// for ways only
Type string `json:"type"`
Nodes []int64 `json:"nodes"`
ID int64 `json:"id"`
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
Tags struct {
Name string `json:"name"`
Natural string `json:"natural"`
Place string `json:"place"`
Tourism string `json:"tourism"`
ShelterType string `json:"shelter_type"`
Ele string `json:"ele"`
} `json:"tags"`
} `json:"elements"`
}
type VisitedAmenity ¶
type VisitedAmenity struct {
Amenity *Amenity
Distance float64
TrackElevation float64
VisitedIndex int
// contains filtered or unexported fields
}
func FindVisitedAmenities ¶
func FindVisitedAmenities(candidates []Point, amenities []*Amenity, op FindOptions) []VisitedAmenity
func (*VisitedAmenity) MarshalJSON ¶
func (v *VisitedAmenity) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.


