geonames

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 16 Imported by: 0

README

Geonames GoDoc License Build Status Coverage Status Go Report Card

Golang wrapper over the geonames.org website dump.

Handlers currently wrapped

  • Country info
  • Time zones
  • Features daily modifications
  • Language codes
  • Hierarchy
  • Features by country iso2 code specified
  • Daily global deletions
  • Cities with > 1/5/15k population
  • Feature alternate names
  • Feature alternate names daily deletions
  • Feature alternate names daily modifications
  • Admin2 codes (UTF8)
  • Admin1 codes (ASCII)
  • User Tags
  • Postal Codes

Credits

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the main entry point for the geonames library

func (*Client) Admin1CodesASCII

func (c *Client) Admin1CodesASCII() ([]*models.AdminCode, error)

Admin1CodesASCII returns all admin1 codes encoded in ASCII

func (*Client) Admin2Codes

func (c *Client) Admin2Codes() ([]*models.AdminCode, error)

Admin2Codes returns all admin2 codes encoded in ASCII

func (*Client) AllCountries

func (c *Client) AllCountries() (map[int]*models.Feature, error)

AllCountries returns a big pack of all features of all countries

func (*Client) AlternateNames

func (c *Client) AlternateNames() ([]*models.AlternateName, error)

AlternateNames returns alternate names for all features available

func (*Client) AlternateNamesDeletes

func (c *Client) AlternateNamesDeletes(year, month, day int) (map[int]*models.AlternateNameDeleteOp, error)

AlternateNamesDeletes returns all deleted alternate names for the selected date

func (*Client) AlternateNamesModifications

func (c *Client) AlternateNamesModifications(year, month, day int) (map[int]*models.AlternateName, error)

AlternateNamesModifications returns all alternate names modified at the selected date

func (*Client) CallAllCountries

func (c *Client) CallAllCountries(handler func(*models.Feature)) error

CallAllCountries calls the passed handler on each extracted feature.

func (*Client) Cities1000

func (c *Client) Cities1000() (map[int]*models.Feature, error)

Cities1000 returns all cities with the population >1000

func (*Client) Cities15000

func (c *Client) Cities15000() (map[int]*models.Feature, error)

Cities15000 returns all cities with the population >15000

func (*Client) Cities5000

func (c *Client) Cities5000() (map[int]*models.Feature, error)

Cities5000 returns all cities with the population >5000

func (*Client) CountryInfo

func (c *Client) CountryInfo() (map[int64]*models.Country, error)

CountryInfo returns a map of all countries

func (*Client) Deletes

func (c *Client) Deletes(year, month, day int) (map[int]*models.DeleteOp, error)

Deletes returns all deleted objects for the selected date

func (*Client) Features

func (c *Client) Features(iso2code string) ([]*models.Feature, error)

Features returns all features for the specified country iso2 code

func (*Client) Hierarchy

func (c *Client) Hierarchy() (map[int][]*models.HierarchyNode, error)

Hierarchy returns all available pairs of linked parents and children For example, a city is linked to it's country as a child: Country->City1,City2 etc

func (*Client) LanguageCodes

func (c *Client) LanguageCodes() ([]*models.LanguageCode, error)

LanguageCodes returns all available languages

func (*Client) Modifications

func (c *Client) Modifications(year, month, day int) (map[string][]string, error)

Modifications returns all modifications made at the selected date WARNING: WIP

func (*Client) PostalCodes

func (c *Client) PostalCodes(iso2code string) (map[string]*models.PostalCode, error)

PostalCodes returns all postal codes for the selected countries iso2 code

func (*Client) TimeZones

func (c *Client) TimeZones() ([]*models.TimeZone, error)

TimeZones returns all time zones available

func (*Client) UserTags

func (c *Client) UserTags() (map[int][]string, error)

UserTags returns all available user tags for any objects of the system

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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