cube

package
v0.0.0-...-e167a70 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conversion

type Conversion struct {
	InputPath  string
	OutputPath string
	OutputType NetOutputType
	OutputFmt  NetOutputFmt
}

Conversion holds all parameters required to generate a Cube Network to Shapefile/DBF conversion script.

func (*Conversion) WriteScript

func (c *Conversion) WriteScript(w io.Writer) error

WriteScript writes a conversion script to the provided writer.

type Link struct{ A, B int64 }

Link holds the A and B node numbers for a network link.

func LinksFromCsv

func LinksFromCsv(path string) ([]Link, error)

LinksFromCsv returns a slice of links from a CSV file with A and B columns.

type LinkSet

type LinkSet map[Link]struct{}

LinkSet holds a set of unique links.

func NewLinkSet

func NewLinkSet(links ...Link) LinkSet

NewLinkSet constructs a LinkSet from provided links.

func (LinkSet) Add

func (l LinkSet) Add(link *Link)

Add adds a given Link to the LinkSet

func (LinkSet) Contains

func (l LinkSet) Contains(link *Link) bool

Contains checks whether a LinkSet contains a given Link.

type NetOutputFmt

type NetOutputFmt string
const (
	Dbf NetOutputFmt = "DBF"
	Shp NetOutputFmt = "SHP"
)

type NetOutputType

type NetOutputType string
const (
	LinkFile NetOutputType = "LINK"
	NodeFile NetOutputType = "NODE"
)

type Route

type Route struct {
	Name  string
	Links []Link
	// contains filtered or unexported fields
}

func RouteFromNodes

func RouteFromNodes(name string, nodes []int64) *Route

RouteFromNodes returns a Route from a name and slice of nodes.

func (*Route) Contains

func (r *Route) Contains(link *Link) bool

Contains checks whether a Route contains a given Link.

Jump to

Keyboard shortcuts

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