reversegeo

package
v0.0.0-...-a22099a Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	ID                 string  `json:"id"`          // 0
	CityName           string  `json:"city_name"`   // 1
	Lat                float64 `json:"lat"`         // 4
	Lon                float64 `json:"lon"`         // 5
	CountryCode        string  `json:"cc"`          // 8
	AdminCode          string  `json:"admin"`       // 10
	CountrySubdivision string  `json:"subdivision"` // 11

	CountryName     string `json:"country_name"`
	SubdivisionName string `json:"subdivison_name"`
	Name            string `json:"name"`
}

func (*Location) ToPlace

func (l *Location) ToPlace() *Place

type Place

type Place struct {
	Lng  float64                `json:"lng"`
	Lat  float64                `json:"lat"`
	Data map[string]interface{} `json:"data"`
}

type ReverseGeo

type ReverseGeo struct {
	// contains filtered or unexported fields
}

func New

func New(rg *rawgeo.RawGeo, kv *kv.KV) (*ReverseGeo, error)

func (*ReverseGeo) Close

func (rg *ReverseGeo) Close() error

func (*ReverseGeo) InitialLoading

func (rg *ReverseGeo) InitialLoading(pathCities1000 string) error

XXX(tsileo): filter by feature class/feature code to only restrict to cities

func (*ReverseGeo) Query

func (rg *ReverseGeo) Query(lat, lng float64, prec int) (*Place, error)

func (*ReverseGeo) SetupAPI

func (rg *ReverseGeo) SetupAPI(router *mux.Router)

Jump to

Keyboard shortcuts

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