lib

package
v0.0.0-...-04d4fff Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 21 Imported by: 4

Documentation

Index

Constants

View Source
const MAX_MEMBER_RELATIONS = 65535

maximum number of child relations a single relation can contain

Variables

This section is empty.

Functions

func EnsureDirectoryExists

func EnsureDirectoryExists(path string, label string) os.FileInfo

EnsureDirectoryExists - otherwise fatally fail

func GetLineCentroid

func GetLineCentroid(ps *geo.PointSet) *geo.Point

GetLineCentroid - compute the centroid of a line string

func GetPolygonCentroid

func GetPolygonCentroid(ps *geo.PointSet) *geo.Point

GetPolygonCentroid - compute the centroid of a polygon set using a spherical co-ordinate system

func MemberType

func MemberType(t gosmparse.MemberType) string

MemberType - map numeric value to string

func TempFileName

func TempFileName(prefix, suffix string) string

TempFileName generates a temporary filename for use in testing or whatever

func WayCentroid

func WayCentroid(refs []*gosmparse.Node) (float64, float64)

WayCentroid - compute the centroid of a way

Types

type Bitmask

type Bitmask struct {
	I map[uint64]uint64
	// contains filtered or unexported fields
}

Bitmask - simple bitmask data structire based on a map

func NewBitMask

func NewBitMask() *Bitmask

NewBitMask - constructor

func (*Bitmask) Has

func (b *Bitmask) Has(val int64) bool

Has - basic get/set methods

func (*Bitmask) Insert

func (b *Bitmask) Insert(val int64)

Insert - basic get/set methods

func (*Bitmask) Len

func (b *Bitmask) Len() uint64

Len - total elements in mask (non performant!)

type BitmaskMap

type BitmaskMap struct {
	Nodes     *Bitmask
	Ways      *Bitmask
	Relations *Bitmask
	WayRefs   *Bitmask
}

BitmaskMap - struct to hold common masks

func NewBitmaskMap

func NewBitmaskMap() *BitmaskMap

NewBitmaskMap - constructor

func (BitmaskMap) Print

func (m BitmaskMap) Print()

Print -- print debug stats

func (*BitmaskMap) ReadFrom

func (m *BitmaskMap) ReadFrom(tap io.Reader) (int64, error)

ReadFrom - read from destination

func (*BitmaskMap) ReadFromFile

func (m *BitmaskMap) ReadFromFile(path string)

ReadFromFile - read from disk

func (*BitmaskMap) WriteTo

func (m *BitmaskMap) WriteTo(sink io.Writer) (int64, error)

WriteTo - write to destination

func (*BitmaskMap) WriteToFile

func (m *BitmaskMap) WriteToFile(path string)

WriteToFile - write to disk

type BufferedWriter

type BufferedWriter struct {
	Queue chan []byte
	// contains filtered or unexported fields
}

BufferedWriter - buffered stdout writer with sync channel

func NewBufferedWriter

func NewBufferedWriter() *BufferedWriter

NewBufferedWriter - constructor

func (*BufferedWriter) Close

func (w *BufferedWriter) Close()

Close - close the channel and block until done

type ChannelHandler

type ChannelHandler struct {
	Channels Channels
}

ChannelHandler struct

func (*ChannelHandler) ReadNode

func (h *ChannelHandler) ReadNode(n gosmparse.Node)

ReadNode - called once per node

func (*ChannelHandler) ReadRelation

func (h *ChannelHandler) ReadRelation(r gosmparse.Relation)

ReadRelation - called once per relation

func (*ChannelHandler) ReadWay

func (h *ChannelHandler) ReadWay(w gosmparse.Way)

ReadWay - called once per way

type Channels

type Channels struct {
	Nodes     chan gosmparse.Node
	Ways      chan gosmparse.Way
	Relations chan gosmparse.Relation
}

Channels struct

func NewChannels

func NewChannels() Channels

NewChannels returns a new struct of channels @!todo: try return as *Channels

func (*Channels) Close

func (c *Channels) Close()

Close all channels

type Condition

type Condition string

Condition - a single match condition

type Config

type Config map[string]Group

Config - struct representing the config file format

type FeatureSet

type FeatureSet struct {
	NodePatterns     Group
	WayPatterns      Group
	RelationPatterns Group
}

FeatureSet struct

func NewFeatureSetFromJSON

func NewFeatureSetFromJSON(path string) (*FeatureSet, error)

NewFeatureSetFromJSON - load a featureset from JSON

func (*FeatureSet) MatchNode

func (fs *FeatureSet) MatchNode(n gosmparse.Node) bool

MatchNode - yes/no if any target feature matches this node

func (*FeatureSet) MatchRelation

func (fs *FeatureSet) MatchRelation(r gosmparse.Relation) bool

MatchRelation - yes/no if any target feature matches this relation

func (*FeatureSet) MatchWay

func (fs *FeatureSet) MatchWay(w gosmparse.Way) bool

MatchWay - yes/no if any target feature matches this way

type Group

type Group []Pattern

Group - a collection of patterns

type Pattern

type Pattern []Condition

Pattern - a collection of conditions

type RelationAssembler

type RelationAssembler struct {
	Relation *gosmparse.Relation
	Conn     *leveldb.Connection
}

RelationAssembler - struct to handle assembling relation dependencies

func (*RelationAssembler) GenerateJSON

func (a *RelationAssembler) GenerateJSON() bytes.Buffer

GenerateJSON - generate a byte buffer of elements encoded in json, one-per-line

Jump to

Keyboard shortcuts

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