nominatim

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

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 New

func New(siteName string) (*Client, error)

Returns new Client with provided siteName.

Returns error if siteName is empty.

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 Coordinates struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

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

Jump to

Keyboard shortcuts

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