geocoding

package
v0.0.0-...-d453d0f Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: MIT Imports: 15 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 {
	Campus        string `json:",omitempty"`
	Locality      string `json:",omitempty"`
	MarketArea    string `json:",omitempty"`
	Neighbourhood string `json:",omitempty"`
	Borough       string `json:",omitempty"`
	Microhood     string `json:",omitempty"`
	County        string `json:",omitempty"`
	MacroCounty   string `json:",omitempty"`
	LocalAdmin    string `json:",omitempty"`
	Region        string `json:",omitempty"`
	MacroRegion   string `json:",omitempty"`
	Country       string `json:",omitempty"`
}

Location contains all the location information for a given location.

func (*Location) String

func (l *Location) String() string

type ReverseGeocoder

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

ReverseGeocoder is a reverse geocoder.

func NewReverseGeocoder

func NewReverseGeocoder(reposFolder, cacheFolder string, countries, enabledPlaceTypes []string) *ReverseGeocoder

NewReverseGeocoder returns a new geocoder from the given folders, countries and place types. reposFolder is the path to where WOF repos must be cloned, cacheFolder contains the cached version of the processed WOF geojsons.

func (*ReverseGeocoder) LoadCachedFiles

func (g *ReverseGeocoder) LoadCachedFiles() error

LoadCachedFiles loads files from the cache folder. The cache should already be populated.

func (*ReverseGeocoder) LocationFromLatLng

func (g *ReverseGeocoder) LocationFromLatLng(lat, lng float64) *Location

LocationFromLatLng returns a Location from the given latitude and longitude.

func (*ReverseGeocoder) UpdateAndLoad

func (g *ReverseGeocoder) UpdateAndLoad() error

UpdateAndLoad loads the data into the index. It first clones and updates the countries repositories, and the process all available geojson, using the cache when available.

Jump to

Keyboard shortcuts

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