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 ¶
- func ObjectType() trv.ObjectType
- type Direction
- type Geometry
- type Response
- type RoadGeometry
- func (x *RoadGeometry) County() *int
- func (x *RoadGeometry) Deleted() *bool
- func (x *RoadGeometry) Direction() *Direction
- func (x *RoadGeometry) Geometry() *Geometry
- func (x *RoadGeometry) Length() *int
- func (x *RoadGeometry) ModifiedTime() *time.Time
- func (x *RoadGeometry) RoadMainNumber() *int
- func (x *RoadGeometry) RoadSubNumber() *int
- func (x *RoadGeometry) TimeStamp() *time.Time
- func (x *RoadGeometry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
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) UnmarshalXML ¶
type Geometry ¶
type Geometry struct {
// contains filtered or unexported fields
}
func (*Geometry) SWEREF99TM3D ¶
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 (*Geometry) WGS843D ¶
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) }
type RoadGeometry ¶
type RoadGeometry struct {
// contains filtered or unexported fields
}
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) 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