geotypes

package
v0.0.0-...-8992cc6 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2015 License: AGPL-3.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	AdditionalInfo  string
	ApartmentLetter string
	ApartmentNumber int
	City            string
	Confidence      float64
	Resolution      int
	Country         string
	CountryCode     string
	HouseNumber     int
	PostalCode      string
	Region          string
	Street          string
}

type CHNode

type CHNode struct {
	Id int
	Coord
}

type Config

type Config struct {
	Host             string
	Port             int
	SslMode          string
	DbUser           string
	DbName           string
	DbHost           string
	DbPort           int
	DbPass           string
	DataDir          string
	RedisAddr        string
	RedisPass        string
	AllowedCountries map[string]bool
}

func (*Config) String

func (config *Config) String() string

type Coord

type Coord []float64

type Coordinate

type Coordinate struct {
	Latitude  float64
	Longitude float64
	System    string
}

type CoordinatePath

type CoordinatePath struct {
	Distance int     `json:"distance"`
	Time     int     `json:"time"`
	Coords   []Coord `json:"coords"`
	SameRoad bool    `json:"-""`
}

type Debugging

type Debugging bool

type Edge

type Edge struct {
	Source Location
	Target Location
}

type GeoDB

type GeoDB interface {
	// Returns the point closest to the coordinates
	// in the road network, based on geoindexed data.
	QueryClosestPoint(point Coord, country string) (CHNode, error)

	// Transforms the nodes from the graph nodes,
	// which are indexed by integers, and returns the corresponding
	// coordinates.
	QueryCoordinates(nodes []int, country string) ([]Coord, error)

	// Gets an address using fuzzy search. Uses the street and city at
	// the moment.
	QueryFuzzyAddress(address Address, count int) ([]Location, error)

	// Calculates the distance between edges. If the array nodes is indexed
	// with the variable i, then edge pairs are formed like thus (i, i+1), (i+1, i+2)
	// and so on.
	QueryDistance(nodes []int, country string) (int, error)

	// Returns the server status, nil if everything works fine.
	QueryStatus() error
}

GeoDB implements a database abstraction layer that hides all functionality related to databases.

type Location

type Location struct {
	Address    Address
	Coordinate Coordinate
}

type Matrix

type Matrix struct {
	Nodes []int `json:"sources"`
}

type NodeEdge

type NodeEdge struct {
	Source int `json:"source"`
	Target int `json:"target"`
}

type Path

type Path struct {
	Length int   `json:"length"`
	Nodes  []int `json:"nodes"`
}

type PathsInput

type PathsInput struct {
	SpeedProfile int
	Edges        []Edge
}

type Ratio

type Ratio struct {
	Id1, Id2, Dist40, Dist60, Dist80, Dist100, Dist120 int
	Ratio, Distance                                    float64
	Oneway                                             bool
	Coord                                              Coord
}

Jump to

Keyboard shortcuts

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