geodata

package
v0.0.0-...-e49772e Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NominatimServer = "https://nominatim.openstreetmap.org"
View Source
var StreetListDirectory = "streetlists"

Functions

func VerifyAnswer

func VerifyAnswer(guess types.Coordinate, answer string) (bool, error)

Types

type BoundingBox

type BoundingBox struct {
	MinLat float64 `json:"minLat"`
	MinLng float64 `json:"minLng"`
	MaxLat float64 `json:"maxLat"`
	MaxLng float64 `json:"maxLng"`
}

type MapOptions

type MapOptions struct {
	BoundingBox *BoundingBox     `json:"boundingBox"`
	Center      types.Coordinate `json:"center"`
	MinZoom     int              `json:"minZoom"`
	MaxZoom     int              `json:"maxZoom"`
}

type Street

type Street struct {
	Name       string
	Coordinate *types.Coordinate `json:"coord"`
}

type StreetList

type StreetList struct {
	FileName   string
	Country    string     `json:"country"`
	City       string     `json:"city"`
	Name       string     `json:"name"`
	MapOptions MapOptions `json:"map"`
	Streets    []string   `json:"streets"`
	// contains filtered or unexported fields
}

func ReadStreetList

func ReadStreetList(fileName string) (*StreetList, error)

func (*StreetList) GetRandomStreet

func (s *StreetList) GetRandomStreet(random *rand.Rand) (Street, error)

type StreetListHeader

type StreetListHeader struct {
	FileName   string
	Name       string     `json:"name"`
	MapOptions MapOptions `json:"map"`
}

func ReadStreetLists

func ReadStreetLists() ([]StreetListHeader, error)

Jump to

Keyboard shortcuts

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