Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { ISO3166 string `json:"ISO3166-2-lvl4"` Borough string `json:"borough"` City string `json:"city"` Country string `json:"country"` CountryCode string `json:"country_code"` Neighbourhood string `json:"neighbourhood"` Postcode string `json:"postcode"` Road string `json:"road"` Shop string `json:"shop"` Suburb string `json:"suburb"` }
type Client ¶ added in v0.0.8
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Lookup ¶ added in v0.0.8
func (n *Client) Lookup(q string) (*LookupResult, error)
Lookup location coordinates based on q
func (*Client) Reverse ¶ added in v0.0.8
func (n *Client) Reverse(lat, lon float64) (*ReverseResult, error)
Reverse search for location based on lat and lon.
API endpoint: https://nominatim.openstreetmap.org/reverse
func (*Client) ReverseLookup ¶ added in v0.0.8
func (n *Client) ReverseLookup(lat, lon float64) (*LookupResult, error)
Lookup location name based on lat and lon
func (*Client) Search ¶ added in v0.0.8
func (c *Client) Search(q string) (*SearchResults, error)
Search for coordinates based on q.
API endpoint: https://nominatim.openstreetmap.org/search
type Coordinates ¶
type LookupResult ¶
type LookupResult struct { Coordinates Location string `json:"location"` }
type ReverseResult ¶
type ReverseResult = SearchResult
type SearchResult ¶
type SearchResult struct { Address *Address `json:"address"` AddressType *string `json:"addresstype"` BoundingBox *[]string `json:"boundingbox"` Category *string `json:"category"` DisplayName *string `json:"display_name"` Importance *float64 `json:"importance"` Latitude *string `json:"lat"` Longitude *string `json:"lon"` Licence *string `json:"licence"` Name *string `json:"name"` OsmId *int `json:"osm_id"` OsmType *string `json:"osm_type"` PlaceId *int `json:"place_id"` PlaceRank *int `json:"place_rank"` Type *string `json:"type"` }
type SearchResults ¶
type SearchResults = []SearchResult
Click to show internal directories.
Click to hide internal directories.