geocode

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForwardRequestOpts

type ForwardRequestOpts struct {
	Country      string           `url:"country,omitempty"`
	Proximity    []float64        `url:"proximity,omitempty"`
	Types        []Type           `url:"types,omitempty"`
	Autocomplete bool             `url:"autocomplete,omitempty"`
	BBox         base.BoundingBox `url:"bbox,omitempty"`
	Limit        uint             `url:"limit,omitempty"`
}

ForwardRequestOpts request options fo forward geocoding

type ForwardResponse

type ForwardResponse struct {
	*base.FeatureCollection
	Query []string
}

ForwardResponse is the response from a forward geocode lookup

type Geocode

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

Geocode api wrapper instance

func NewGeocode

func NewGeocode(base *base.Base) *Geocode

NewGeocode Create a new Geocode API wrapper

func (*Geocode) Forward

func (g *Geocode) Forward(place string, req *ForwardRequestOpts) (*ForwardResponse, error)

Forward geocode lookup Finds locations from a place name

func (*Geocode) Reverse

func (g *Geocode) Reverse(loc *base.Location, req *ReverseRequestOpts) (*ReverseResponse, error)

Reverse geocode lookup Finds place names from a location

type ReverseRequestOpts

type ReverseRequestOpts struct {
	Types []Type
	Limit uint
}

ReverseRequestOpts request options fo reverse geocoding

type ReverseResponse

type ReverseResponse struct {
	*base.FeatureCollection
	Query []float64
}

ReverseResponse is the response to a reverse geocode request

type Type

type Type string

Type defines geocode location response types

const (
	// Country level
	Country Type = "country"
	// Region level
	Region Type = "region"
	// Postcode level
	Postcode Type = "postcode"
	// District level
	District Type = "district"
	// Place level
	Place Type = "place"
	// Locality level
	Locality Type = "locality"
	// Neighborhood level
	Neighborhood Type = "neighborhood"
	// Address level
	Address Type = "address"
	// POI (Point of Interest) level
	POI Type = "poi"
)

Jump to

Keyboard shortcuts

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