nearby

package module
v0.0.0-...-392f246 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2016 License: BSD-3-Clause Imports: 8 Imported by: 0

README

go-whosonfirst-nearby

An in-memory KNearest index for Who's On First documents (using hailocab's go-geoindex)

Caveats

This is not ready for you to use yet.

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(p geoindex.Point) bool

type Index

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

func NewIndex

func NewIndex(logger log.WOFLog) *Index

func (*Index) IndexCSVFile

func (i *Index) IndexCSVFile(csv_file string, key map[string]string) (bool, error)

func (*Index) IndexFeature

func (i *Index) IndexFeature(f *geojson.WOFFeature) (bool, error)

func (*Index) Nearby

func (i *Index) Nearby(lat float64, lon float64, max int, dist float64) []*Result

func (*Index) NearbyWithCallback

func (i *Index) NearbyWithCallback(lat float64, lon float64, max int, dist float64, cb Callback) []*Result

type Record

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

func NewRecord

func NewRecord(id string, lat float64, lon float64) (*Record, error)

func NewRecordFromFeature

func NewRecordFromFeature(f *geojson.WOFFeature) (*Record, error)

func (*Record) Id

func (r *Record) Id() string

func (*Record) Lat

func (r *Record) Lat() float64

func (*Record) Lon

func (r *Record) Lon() float64

func (*Record) Stringer

func (r *Record) Stringer() string

type Result

type Result struct {
	Id        int // int64
	Latitude  float64
	Longitude float64
}

func NewResultsFromPoint

func NewResultsFromPoint(pt geoindex.Point) *Result

func (*Result) Stringer

func (r *Result) Stringer() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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