shared

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package shared is used by annotate and the internal core. External usage of this package is for advanced use only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Child

type Child struct {
	ID          osm.FeatureID
	Version     int
	ChangesetID osm.ChangesetID

	// VersionIndex is the index of the version if sorted from lowest to highest.
	// This is necessary since version don't have to start at 1 or be sequential.
	VersionIndex int
	Timestamp    time.Time
	Committed    time.Time

	// for nodes
	Lon, Lat float64

	// for ways
	Way               *osm.Way
	ReverseOfPrevious bool

	// moving the visible bool here decreases the struct size from
	// size 120 (size class 128) to 112 (size class 112).
	Visible bool
}

A Child represents a node, way or relation that is a dependent for annotating ways or relations.

func FromNode

func FromNode(n *osm.Node) *Child

FromNode converts a node to a child.

func FromRelation

func FromRelation(r *osm.Relation) *Child

FromRelation converts a way to a child.

func FromWay

func FromWay(w *osm.Way) *Child

FromWay converts a way to a child.

func (*Child) Update

func (c *Child) Update() osm.Update

Update generates an update from this child.

Jump to

Keyboard shortcuts

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