element

package
v0.0.0-...-85720d3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package element provides basic types for OSM elements (coords/nodes/ways/relations/etc).

Index

Constants

View Source
const (
	NODE     MemberType = 0
	WAY                 = 1
	RELATION            = 2
)

Variables

View Source
var MemberTypeValues = map[string]MemberType{
	"node":     NODE,
	"way":      WAY,
	"relation": RELATION,
}

Functions

This section is empty.

Types

type Geometry

type Geometry struct {
	Geom *geos.Geom
	Wkb  []byte
}

type IdRefs

type IdRefs struct {
	Id   int64
	Refs []int64
}

func (*IdRefs) Add

func (idRefs *IdRefs) Add(ref int64)

func (*IdRefs) Delete

func (idRefs *IdRefs) Delete(ref int64)

type Member

type Member struct {
	Id   int64      `json:"id"`
	Type MemberType `json:"type"`
	Role string     `json:"role"`
	Way  *Way       `json:"-"`
}

type MemberType

type MemberType int

type Node

type Node struct {
	OSMElem
	Lat  float64 `json:"lat"`
	Long float64 `json:"lon"`
}

type OSMElem

type OSMElem struct {
	Id   int64     `json:"-"`
	Tags Tags      `json:"tags,omitempty"`
	Geom *Geometry `json:"-"`
}

type Relation

type Relation struct {
	OSMElem
	Members []Member `json:"members"`
}

type Tags

type Tags map[string]string

type Way

type Way struct {
	OSMElem
	Refs  []int64 `json:"refs"`
	Nodes []Node  `json:"nodes,omitempty"`
}

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