geocoder

package module
v0.0.0-...-5ea8314 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2016 License: CC0-1.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(requestString string, maxResults int) *requestBody

NewRequest create a new request to server

Types

type GeoCoder

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

GeoCoder - base structure to work with package. It help you to store configuration between requests.

func New

func New() *GeoCoder

New - create new GeoCoder object.

func (GeoCoder) FindOne

func (g GeoCoder) FindOne(requestString string) *GeoObject

FindOne send request to server and retern only one result.

func (GeoCoder) FindOneFromScope

func (g GeoCoder) FindOneFromScope(requestString string, scope Scope) GeoObject

FindOneFromScope send request to server and retern only one result placed in scope.

func (GeoCoder) FindOneReverse

func (g GeoCoder) FindOneReverse(N, E float64, kind string) GeoObject

FindOneReverse send reverse request to server and retern only one result.

type GeoObject

type GeoObject struct {
	MetaDataProperty metaDataPropertyType `xml:"metaDataProperty"`
	Description      string               `xml:"description"`
	Name             string               `xml:"name"`
	BoundedBy        boundedByType        `xml:"boundedBy"`
	Point            pointType            `xml:"Point"`
}

func Find

func Find(requestString string, maxResults int) []GeoObject

Find send request to server and retern results. Argument maxResults set maximum number of results.

func FindOne

func FindOne(requestString string) *GeoObject

FindOne send request to server and retern only one result.

func FindOneFromScope

func FindOneFromScope(requestString string, scope Scope) GeoObject

FindOneFromScope send request to server and retern only one result placed in scope.

func FindOneReverse

func FindOneReverse(N, E float64, kind string) GeoObject

FindOneReverse send reverse request to server and retern only one result.

func (GeoObject) Address

func (g GeoObject) Address() string

Address return address string of GeoObject

func (GeoObject) AdministrativeArea

func (g GeoObject) AdministrativeArea() string

AdministrativeArea return administrative area of GeoObject

func (GeoObject) Country

func (g GeoObject) Country() string

Country return country name of GeoObject

func (GeoObject) CountryCode

func (g GeoObject) CountryCode() string

CountryCode return country code of GeoObject

func (GeoObject) GeoPoint

func (g GeoObject) GeoPoint() (*GeoPoint, error)

GeoPoint return coordinates of GeoObject

func (GeoObject) Kind

func (g GeoObject) Kind() string

Kind return kind of GeoObject

func (GeoObject) Locality

func (g GeoObject) Locality() string

Locality return locality of GeoObject

func (GeoObject) Premise

func (g GeoObject) Premise() string

Premise return premise of GeoObject

func (GeoObject) Scope

func (g GeoObject) Scope() *Scope

Scope return scope of GeoObject

func (GeoObject) SubAdministrativeArea

func (g GeoObject) SubAdministrativeArea() string

SubAdministrativeArea return subadministrative area of GeoObject

func (GeoObject) Thoroughfare

func (g GeoObject) Thoroughfare() string

Thoroughfare return thoroughfare of GeoObject

type GeoPoint

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

GeoPoint represent point on map.

func NewGeoPoint

func NewGeoPoint(posString string) (*GeoPoint, error)

NewGeoPoint - create a new point. Function get as argument string with geo coordinates, for example "55.753514 37.621202". number 55.753514 is latitude, and 37.621202 is longitude.

func (GeoPoint) Latitude

func (g GeoPoint) Latitude() float64

Latitude return latitude of GeoPoint.

func (GeoPoint) Longitude

func (g GeoPoint) Longitude() float64

Longitude return longitude of GeoPoint.

func (GeoPoint) String

func (g GeoPoint) String() string

String represent GeoPoint as String.

type PremiseType

type PremiseType struct {
	PremiseNumber string `xml:"PremiseNumber"`
}

type Scope

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

Scope represent area on map, rectangle bounded with two point. Two point placed in opposite corners of rectangle.

func NewScope

func NewScope(LowerCorner, UpperCorner GeoPoint) *Scope

NewScope create a new scope. Function get as argument 2 GeoPoint.

func (Scope) Center

func (s Scope) Center() *GeoPoint

Center return GeoPoint of center of Scope.

func (Scope) Size

func (s Scope) Size() *ScopeSize

Size return size of Scope.

type ScopeSize

type ScopeSize struct {
	GeoPoint
}

ScopeSize represent size of Scope. Latitude is width of rectangle. Longitude is height of rectangle.

Jump to

Keyboard shortcuts

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