netconvert

package module
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: 5 Imported by: 0

README

Gitpod Ready-to-Code

go-netconvert

A simple parser for osm.xml files. Reads nodes and ways into golang structs. Provides util functions to filter and to write back parsed network.

A command line tool to use the functionalities is also provided: netconvert

Go get

go get github.com/EricNeid/go-netconvert

Usage

import "github.com/EricNeid/go-netconvert"

net, err := netconvert.Decode(xmlFile)
if err != nil {
  // handle error
  return
}

fmt.Printf("Finished parsing xml\n")
fmt.Printf("Number of nodes: %d\n", len(net.Nodes))
fmt.Printf("Number of ways:  %d\n", len(net.Ways))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(xmlFile string) (*osm.Net, error)

Decode parses given xmlFile (which should be osm.xml) and returns the parsed net (containing edges and nodes).

func DecodeNode

func DecodeNode(decoder *xml.Decoder, se *xml.StartElement) (osm.Node, error)

DecodeNode parsed given start element into instance of Node

func DecodeWay

func DecodeWay(decoder *xml.Decoder, se *xml.StartElement) (osm.Way, error)

DecodeWay parses given start element into instance of Way

Types

This section is empty.

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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