camlistore.org: camlistore.org/pkg/geocode Index | Files

package geocode

import "camlistore.org/pkg/geocode"

Package geocode handles mapping user-entered locations into lat/long polygons.

Index

Package Files

geocode.go

Variables

var AltLookupFn func(ctx context.Context, address string) ([]Rect, error)

AltLookupFn provides alternative geocode lookup in tests.

If AltLookupFn is not nil, Lookup calls AltLookupFn first, and returns the results unless it is (nil, nil).

Lookup performs its standard lookup using its cache and the Google geocoding serice if AltLookupFn is nil, or it returns (nil, nil) for the address being looked up.

It's up to the caller to change AltLookupFn only when Lookup is not being called.

func Lookup Uses

func Lookup(ctx context.Context, address string) ([]Rect, error)

Lookup returns rectangles for the given address. Currently the only implementation is the Google geocoding service.

type LatLong Uses

type LatLong struct {
    Lat  float64 `json:"lat"`
    Long float64 `json:"lng"`
}

type Rect Uses

type Rect struct {
    NorthEast LatLong `json:"northeast"`
    SouthWest LatLong `json:"southwest"`
}

Package geocode imports 9 packages (graph) and is imported by 25 packages. Updated 2018-01-16. Refresh now. Tools for package owners.