naptan

package
v0.0.0-...-73876c2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DateTimeFormat string = "2006-01-02T15:04:05"

Variables

This section is empty.

Functions

This section is empty.

Types

type BusStopClassification

type BusStopClassification struct {
	BusStopType string
	Bearing     string `xml:"MarkedPoint>Bearing>CompassPoint"`
}

type CoachStopClassification

type CoachStopClassification struct {
}

type Location

type Location struct {
	GridType  string
	Easting   string
	Northing  string
	Longitude float64 `xml:"Translation>Longitude"`
	Latitude  float64 `xml:"Translation>Latitude"`
}

func (*Location) UpdateCoordinates

func (l *Location) UpdateCoordinates()

type MetroStopClassification

type MetroStopClassification struct {
}

type NaPTAN

type NaPTAN struct {
	CreationDateTime     string `xml:",attr"`
	ModificationDateTime string `xml:",attr"`

	SchemaVersion string `xml:",attr"`

	StopPoints []*StopPoint
	StopAreas  []*StopArea
}

func (*NaPTAN) Import

func (naptanDoc *NaPTAN) Import(dataset datasets.DataSet, datasource *ctdf.DataSource) error

func (*NaPTAN) ParseFile

func (n *NaPTAN) ParseFile(reader io.Reader) error

func (*NaPTAN) Validate

func (naptanDoc *NaPTAN) Validate() error

type RailStopClassification

type RailStopClassification struct {
	AnnotatedRailRef struct {
		TiplocRef   string
		CrsRef      string
		StationName string
	}
}

type StopArea

type StopArea struct {
	CreationDateTime     string `xml:",attr"`
	ModificationDateTime string `xml:",attr"`
	Status               string `xml:",attr"`

	StopAreaCode          string
	Name                  string
	AdministrativeAreaRef string
	StopAreaType          string

	Location *Location

	Stops []StopPoint
}

func (*StopArea) ToCTDF

func (orig *StopArea) ToCTDF() *ctdf.StopGroup

type StopClassification

type StopClassification struct {
	StopType string

	OnStreet struct {
		Bus *BusStopClassification
	}

	OffStreet struct {
		Bus   *BusStopClassification
		Rail  *RailStopClassification
		Coach *CoachStopClassification
		Metro *MetroStopClassification
	}
}

type StopPoint

type StopPoint struct {
	CreationDateTime     string `xml:",attr"`
	ModificationDateTime string `xml:",attr"`
	Status               string `xml:",attr"`

	AtcoCode              string
	NaptanCode            string
	AdministrativeAreaRef string

	Descriptor *StopPointDescriptor

	NptgLocalityRef string    `xml:"Place>NptgLocalityRef"`
	LocalityCentre  bool      `xml:"Place>LocalityCentre"`
	Location        *Location `xml:"Place>Location"`

	StopClassification StopClassification

	StopAreas []StopPointStopAreaRef `xml:"StopAreas>StopAreaRef"`
}

func (*StopPoint) ToCTDF

func (orig *StopPoint) ToCTDF() *ctdf.Stop

type StopPointDescriptor

type StopPointDescriptor struct {
	CommonName      string
	ShortCommonName string
	Landmark        string
	Street          string
	Indicator       string
}

type StopPointStopAreaRef

type StopPointStopAreaRef struct {
	CreationDateTime     string `xml:",attr"`
	ModificationDateTime string `xml:",attr"`
	Status               string `xml:",attr"`

	StopAreaCode string `xml:",chardata"`
}

Jump to

Keyboard shortcuts

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