routedb

package module
v0.0.0-...-a9696b1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2015 License: MIT Imports: 9 Imported by: 0

README

routedb

Package routedb includes routines for maintaining and querying a database of transport network routes.

Travis Build

build status

Documentation

Overview

Package routedb includes routines for maintaining and querying a database of transport network routes.

Because this package is used in Android apps, this API is (and must remain) compatible with the limitations of gobind.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Box

type Box struct {
	N, E, S, W float64
}

A Box is a region defined by two latitudes (N, S) and two longitudes (E, W).

type Db

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

A Db represents an in-memory copy of the transport database.

func Load

func Load(in []byte) (db *Db, err error)

Load loads a routedb, returning a Db that can be queried, or an error.

func (*Db) Bounds

func (db *Db) Bounds() *Box

Bounds returns the box bounding all the waypoints in all the routes in the database. It returns a *Box to be compatible with gobind.

func (*Db) Nearest

func (db *Db) Nearest(lat, lon float64) (stop *Stop, err error)

func (*Db) Route

func (db *Db) Route(i int) ([]byte, error)

Route returns the selected route as a FlatBuffer.

func (*Db) Routes

func (db *Db) Routes() int

Routes returns the number of routes.

type Stop

type Stop struct {
	Lat, Lon float64
}

A Stop is a place where a bus stops (or could be hailed).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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