structures

package
v0.0.0-...-63ab681 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Version   int32
	Uid       int32
	Timestamp time.Time
	Changeset int64
	User      string
	Visible   bool
}

type LineString

type LineString struct {
	Type        string      `bson:"type"`
	Coordinates []geo.Point `bson:"coordinates"`
}

type Member

type Member struct {
	ID   int64 `bson:"_id"`
	Type MemberType
	Role string
	Way  *Way  `json:"-"`
	Node *Node `json:"-"`
}

type MemberType

type MemberType int
const (
	NodeType MemberType = iota
	WayType
	RelationType
)

type Node

type Node struct {
	ID   int64 `bson:"_id"`
	Lat  float64
	Lon  float64
	Tags map[string]string
	Info Info

	//BSON Data (Needs to be set before inserting the object)
	Loc *Point `bson:"loc"`
}

func GetNodeById

func GetNodeById(id int64, nodes []Node) *Node

type Object

type Object struct {
	OsmId int64             `bson:"osm_id"`
	Tags  map[string]string `bson:"tags"`

	//Location
	Loc    interface{} `bson:"loc"`
	Center interface{} `bson:"center,omitempty"`
}

type Point

type Point struct {
	Type        string    `bson:"type"`
	Coordinates geo.Point `bson:"coordinates"`
}

type Polygon

type Polygon struct {
	Type        string        `bson:"type"`
	Coordinates [][]geo.Point `bson:"coordinates"`
}

type Ref

type Ref struct {
	XMLName xml.Name `xml:"nd"`
	Ref     int64    `xml:"ref,attr"`
}

type Relation

type Relation struct {
	ID      int64 `bson:"_id"`
	Tags    map[string]string
	Members []Member
	Info    Info
	Loc     *struct {
		Type        string      `bson:"type"`
		Coordinates [][]float64 `bson:"coordinates"`
	} `bson:"loc,omitempty"`
}

func (*Relation) FeedCoordinates

func (r *Relation) FeedCoordinates(members []interface{})

type Way

type Way struct {
	ID      int64 `bson:"_id"`
	Tags    map[string]string
	NodeIDs []int64
	Info    Info
	Nodes   []Node

	Center *Point      `bson:"center,omitempty"`
	Loc    interface{} `bson:"loc,omitempty"`
}

func (*Way) FeedCoordinates

func (w *Way) FeedCoordinates(nodes []Node) error

func (*Way) IsClosed

func (w *Way) IsClosed() bool

Jump to

Keyboard shortcuts

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