v1

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package v1 contains the type definitions for RoadGeometry v1.

All types have accessor methods to access fields which can be chained on nils. This makes it possible to easily drill down into deeply nested data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ObjectType

func ObjectType() trv.ObjectType

Types

type Direction

type Direction struct {
	// contains filtered or unexported fields
}

func (*Direction) Code

func (x *Direction) Code() *int

SV: Riktning. Värde.

func (*Direction) UnmarshalXML

func (x *Direction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*Direction) Value

func (x *Direction) Value() *string

SV: Riktning. Beskrivning.

type Geometry

type Geometry struct {
	// contains filtered or unexported fields
}

func (*Geometry) SWEREF99TM3D

func (x *Geometry) SWEREF99TM3D() *string

SV: Geometrisk 3D punkt i koordinatsystem SWEREF99TM. Vissa koordinater kan sakna höjdvärde. Höjdvärdet anges i meter i <a href="https://www.lantmateriet.se/sv/Kartor-och-geografisk-information/GPS-och-geodetisk-matning/Referenssystem/Hojdsystem/RH-2000/" target="_blank">RH 2000</a>

func (*Geometry) UnmarshalXML

func (x *Geometry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*Geometry) WGS843D

func (x *Geometry) WGS843D() *string

SV: Geometrisk 3D punkt i koordinatsystem WGS84. Vissa koordinater kan sakna höjdvärde. Höjdvärdet anges i meter i <a href="https://www.lantmateriet.se/sv/Kartor-och-geografisk-information/GPS-och-geodetisk-matning/Referenssystem/Hojdsystem/RH-2000/" target="_blank">RH 2000</a>

type Response

type Response struct {
	XMLName xml.Name `xml:"RESPONSE"`
	Results []struct {
		Info struct {
			LastModified trv.LastModified `xml:"LASTMODIFIED"`
			LastChangeID string           `xml:"LASTCHANGEID"`
			EvalResult   []any            `xml:"EVALRESULT"`
			SSEURL       string           `xml:"SSEURL"`
		} `xml:"INFO"`
		Error *trv.APIError  `xml:"ERROR"`
		Data  []RoadGeometry `xml:"RoadGeometry"`
	} `xml:"RESULT"`
}

Response can be used to decode the response from the API.

For example:

package main

import (
	 "encoding/xml"
	 api "code.dny.dev/trafikinfo/trv/roadgeometry/v1"
)

func main() {
	var res api.Response
	err := xml.Unmarshal(data, &res)
}

func (Response) ErrorMsg

func (r Response) ErrorMsg() string

Errors returns a slice of trv.Error, if any error was included in the response.

func (Response) HasErrors

func (r Response) HasErrors() bool

HasErrors returns whether any of the results includes an error.

type RoadGeometry

type RoadGeometry struct {
	// contains filtered or unexported fields
}

func (*RoadGeometry) County

func (x *RoadGeometry) County() *int

SV: Län.

func (*RoadGeometry) Deleted

func (x *RoadGeometry) Deleted() *bool

SV: Anger att dataposten raderats EN: Indicates that the data record has been deleted

func (*RoadGeometry) Direction

func (x *RoadGeometry) Direction() *Direction

func (*RoadGeometry) Geometry

func (x *RoadGeometry) Geometry() *Geometry

func (*RoadGeometry) Length

func (x *RoadGeometry) Length() *int

SV: Längd.

func (*RoadGeometry) ModifiedTime

func (x *RoadGeometry) ModifiedTime() *time.Time

SV: Tidpunkt då dataposten ändrades EN: Time when the data item was changed

func (*RoadGeometry) RoadMainNumber

func (x *RoadGeometry) RoadMainNumber() *int

SV: Huvudvägnummer.

func (*RoadGeometry) RoadSubNumber

func (x *RoadGeometry) RoadSubNumber() *int

SV: Undervägnummer. Kallas ibland även punktväg. Måste användas ihop med huvudvägnumret.

func (*RoadGeometry) TimeStamp

func (x *RoadGeometry) TimeStamp() *time.Time

SV: Datum för när vägdata hämtades ut från källsystemen.

func (*RoadGeometry) UnmarshalXML

func (x *RoadGeometry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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