osm

package
v0.0.0-...-5283a38 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Net

type Net struct {
	Nodes []Node
	Ways  []Way
}

Net represents a parsed osm net

type Node

type Node struct {
	ID   int64   `xml:"id,attr"`
	Lat  float32 `xml:"lat,attr"`
	Lon  float32 `xml:"lon,attr"`
	Tags []Tag   `xml:"tag"`
}

Node is a single osm node

type NodeRef

type NodeRef struct {
	NodeID int64 `xml:"ref,attr"`
}

NodeRef is a single node reference in osm way

type Tag

type Tag struct {
	Name  string `xml:"k,attr"`
	Value string `xml:"v,attr"`
}

Tag represents a single osm tag. It is used by both way and edges.

func (Tag) IsName

func (t Tag) IsName() bool

IsName returns true if the given tag describes a name.

func (Tag) IsRegName

func (t Tag) IsRegName() bool

IsRegName returns true if the given tag describes a regional name.

type Way

type Way struct {
	ID       int64     `xml:"id,attr"`
	NodeRefs []NodeRef `xml:"nd"`
	Tags     []Tag     `xml:"tag"`
}

Way is a single osm way

Sample of pared xml:

<way id="4040481">
	<nd ref="21380156"/>
	<nd ref="243068174"/>
	<tag k="highway" v="motorway"/>
	<tag k="int_ref" v="E 26"/>
	<tag k="lanes" v="2"/>
	<tag k="lit" v="no"/>
	<tag k="maxspeed" v="none"/>
	<tag k="oneway" v="yes"/>
	<tag k="ref" v="A 24"/>
	<tag k="source:lit" v="http://www.autobahn-bilder.de"/>
	<tag k="surface" v="asphalt"/>
</way>

Jump to

Keyboard shortcuts

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