Documentation
¶
Overview ¶
Package geo is a generic framework to develop geocode/reverse geocode clients
Index ¶
Constants ¶
const DefaultTimeout = time.Second * 8
DefaultTimeout for the request execution
Variables ¶
var ErrTimeout = errors.New("TIMEOUT")
ErrTimeout occurs when no response returned within timeoutInSeconds
Functions ¶
func ParseFloat ¶
ParseFloat is a helper to parse a string to a float
Types ¶
type Address ¶
type Address struct {
FormattedAddress string
Street string
HouseNumber string
Suburb string
Postcode string
State string
StateCode string
StateDistrict string
County string
Country string
CountryCode string
City string
}
Address is returned by ReverseGeocode. This is a structured representation of an address, including its flat representation
type EndpointBuilder ¶
EndpointBuilder defines functions that build urls for geocode/reverse geocode
type Geocoder ¶
type Geocoder interface {
Geocode(address string) (*Location, error)
ReverseGeocode(lat, lng float64) (*Address, error)
}
Geocoder can look up (lat, long) by address and address by (lat, long)
type HTTPGeocoder ¶
type HTTPGeocoder struct {
EndpointBuilder
ResponseParserFactory
ResponseUnmarshaler
}
HTTPGeocoder has EndpointBuilder and ResponseParser
func (HTTPGeocoder) Geocode ¶
func (g HTTPGeocoder) Geocode(address string) (*Location, error)
Geocode returns location for address
func (HTTPGeocoder) ReverseGeocode ¶
func (g HTTPGeocoder) ReverseGeocode(lat, lng float64) (*Address, error)
ReverseGeocode returns address for location
type JSONUnmarshaler ¶ added in v1.8.5
type JSONUnmarshaler struct{}
type ResponseParser ¶
ResponseParser defines functions that parse response of geocode/reverse geocode
type ResponseParserFactory ¶
type ResponseParserFactory func() ResponseParser
ResponseParserFactory creates a new ResponseParser
type ResponseUnmarshaler ¶ added in v1.8.5
type StdLogger ¶
type StdLogger interface {
Printf(string, ...interface{})
}
StdLogger is a interface for logging libraries.
DebugLogger is an implementation of StdLogger that geo uses to log its debug messages.
type XMLUnmarshaler ¶ added in v1.8.5
type XMLUnmarshaler struct{}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package arcgis is a geo-golang based ArcGIS geocode/reverse client
|
Package arcgis is a geo-golang based ArcGIS geocode/reverse client |
|
Package bing is a geo-golang based Microsoft Bing geocode/reverse geocode client
|
Package bing is a geo-golang based Microsoft Bing geocode/reverse geocode client |
|
Package frenchapigouv is a geo-golang based French API Gouv geocode/reverse geocode client
|
Package frenchapigouv is a geo-golang based French API Gouv geocode/reverse geocode client |
|
Package google is a geo-golang based Google Geo Location API https://developers.google.com/maps/documentation/geocoding/intro
|
Package google is a geo-golang based Google Geo Location API https://developers.google.com/maps/documentation/geocoding/intro |
|
Package here is a geo-golang based HERE geocode/reverse geocode client for the legacy geocoder API
|
Package here is a geo-golang based HERE geocode/reverse geocode client for the legacy geocoder API |
|
search
Package search is a geo-golang based HERE geocode/reverse geocode client for the Geocoding and Search API
|
Package search is a geo-golang based HERE geocode/reverse geocode client for the Geocoding and Search API |
|
Package locationiq is a geo-golang based LocationIQ geocode/reverse geocode client
|
Package locationiq is a geo-golang based LocationIQ geocode/reverse geocode client |
|
Package mapbox is a geo-golang based Mapbox geocode/reverse geocode client
|
Package mapbox is a geo-golang based Mapbox geocode/reverse geocode client |
|
mapquest
|
|
|
nominatim
Package nominatim is a geo-golang based MapRequest Nominatim geocode/reverse geocode client
|
Package nominatim is a geo-golang based MapRequest Nominatim geocode/reverse geocode client |
|
open
Package open is a geo-golang based MapRequest Open geocode/reverse geocode client
|
Package open is a geo-golang based MapRequest Open geocode/reverse geocode client |
|
Package mapzen is a geo-golang based Mapzen geocode/reverse client
|
Package mapzen is a geo-golang based Mapzen geocode/reverse client |
|
Package opencage is a geo-golang based OpenCage geocode/reverse geocode client
|
Package opencage is a geo-golang based OpenCage geocode/reverse geocode client |
|
Package openstreetmap is a geo-golang based OpenStreetMap geocode/reverse geocode client
|
Package openstreetmap is a geo-golang based OpenStreetMap geocode/reverse geocode client |
|
Package osm provides common types for OpenStreetMap used by various providers and some helper functions to reduce code repetition across specific client implementations.
|
Package osm provides common types for OpenStreetMap used by various providers and some helper functions to reduce code repetition across specific client implementations. |
|
Package pickpoint is a geo-golang based PickPoint geocode/reverse geocode client
|
Package pickpoint is a geo-golang based PickPoint geocode/reverse geocode client |
|
Package tomtom is a geo-golang based TomTom geocode/reverse geocode client
|
Package tomtom is a geo-golang based TomTom geocode/reverse geocode client |
|
Package yandex is a geo-golang based Yandex Maps Location API
|
Package yandex is a geo-golang based Yandex Maps Location API |