Trafikverket.NET 0.27.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Trafikverket.NET --version 0.27.0
NuGet\Install-Package Trafikverket.NET -Version 0.27.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Trafikverket.NET" Version="0.27.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Trafikverket.NET --version 0.27.0
#r "nuget: Trafikverket.NET, 0.27.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Trafikverket.NET as a Cake Addin
#addin nuget:?package=Trafikverket.NET&version=0.27.0

// Install Trafikverket.NET as a Cake Tool
#tool nuget:?package=Trafikverket.NET&version=0.27.0

Trafikverket.NET v0.27.0

A C# .NET Standard library for Trafikverket. This is not an official Trafikverket library.

Documentation

All of the XML documentation found in this API library comes from Trafikverket.

Usage

How to create a basic, unfiltered TrainStation request:

Trafikverket Trafikverket = new Trafikverket("Your-Key-Here");
TrainStationResponse[] Response = Trafikverket.TrainStation.ExecuteRequest();
Console.WriteLine(String.Join(",\r\n", Response.Select(x => x.AdvertisedLocationName)));

Example Response: Abborrträsk, Almnäs, Astrid Lindgrens värld, Almedal, [...]

How to create a more advanced, unfiltered TrainAnnouncement request (this way, you can create multiple queries instead of being restricted to only one like above):

TrafikverketResponse Response = Trafikverket.ExecuteRequest(new TrafikverketRequest(new Query(ObjectType.TrainAnnouncement, "1")));
Console.WriteLine(String.Join(",\r\n", Response.TrainAnnouncementResponse.Select(x => x.LocationSignature)));

Example Response: Hel, Sod, Sol, Sci, [...]

How to create a more advanced, filtered TrainMessage request:

TrafikverketResponse Response = Trafikverket.ExecuteRequest(new TrafikverketRequest(new Query(ObjectType.TrainMessage, "1.4", new Filter().AddOperator(new FilterOperator(FilterOperatorType.EQ, "AffectedLocation", "Cst")))));
Console.WriteLine(String.Join(",\r\n", Response.TrainMessageResponse.Select(x => x.Header)));

Example Response: Banarbete, Banarbete, Signalfel, Banarbete, [...]

Dev Note

If you're unsure which Schema Version this library currently supports, be sure to go into the respective API class and see the 'CurrentSchemaVersion' property. Warning: Whichever 'CurrentSchemaVersion' version it's set to, does not mean that it's backwards compatible with previous versions, e.g if 'CurrentSchemaVersion' is "1.5", it does not support all the previous versions, you have to use version "1.5" specifically.

GetSchemaVersion Dictionary

To get which Schema Version the library supports, you can access a dictionary located in the 'Trafikverket' class. Example: String SchemaVersion = Trafikverket.GetSchemaVersion[ObjectType.TrainStation];

Changelog

For every release, you can find the changelog to see what has changed from the previous release to that one under the said release. If a release contains nothing but the 'Included APIs' tab, that means nothing that should concern the user has been changed and a few APIs have been added. If you still are curious for all the things which have been changed from version x to version y, you can check out the commit history since I try to document everything I do there.

Support

This project currently only officially supports .NET Standard 2.0.

NuGet

For simplicity, you can now download the library via NuGet!

Install-Package Trafikverket.NET

Dependencies

This project uses one third-party dependency, which is Newtonsoft.Json (12.0.2) by user JamesNK. NuGet Link: Newtonsoft.Json (12.0.2). Insight.

API Implementation List (For more detailed progress head to Projects):

  • TrainAnnouncement 1.5 - Tidtabellsinformation, d.v.s information om tåg på trafikplatser (stationer, hållplatser) varje post motsvarar ett visst tåg vid respektive trafikplats.
  • TrainMessage 1.4 - Tågtrafikmeddelande, exempelvis information kring banarbete, tågfel, anläggningsfel och dylikt.
  • TrainStation 1 - Trafikplatser, både med och utan resandeutbyte.
  • Camera 1 - Kameror för automatisk väglag och trafikflöde.
  • FerryAnnouncement 1.2 - Ankomster och avgångar.
  • FerryRoute 1.2 - Information om färjeleder.
  • Icon 1 - Ikoner, exempelvis för använding i grafiska användargränssnitt och kartor.
  • Parking 1 - Information om rastplatser och parkeringar.
  • RoadCondition 1.2 - Information om väglag.
  • RoadConditionOverview 1 - Väglagsöversikter.
  • Situation 1.2 - Situationer innehållandes händelser och störningar som trafikmeddelanden, vägarbeten, olyckor, restiktioner m.m.
  • TrafficFlow 1 - Uppmätta eller härledda värden relaterat till trafik eller enskilda fordonets rörelser på en viss sektion eller vid en specifik punkt på vägnätet.
  • TrafficSafetyCamera 1 - Trafiksäkerhetskameror.
  • TravelTimeRoute 1.4 - Restider i större städer eller i högbelastade trafiksystem. Beräkning av restid baseras på data från detektorer som är utplacerade längs bestämda rutter.
  • WeatherStation 1 - Väderstationer med mätdata.
  • MeasurementData100 1 - Mätdata per 100 meter. Ett medelvärde har räknats fram för 100 meter baserat på de ingående 20-metersvärdena (se mer info i MeasurementData20). Observera att det inte finns 100-metersdata för alla våra 20-metersvariabler. Källsystem är PMS-systemen.
  • MeasurementData20 1 - Mätdata per 20 meter. Data från vägytemätningar med laserscanning alternativt som beräknats fram baserat på dem. Mätningarna utförs årligen eller vartannat år beroende på trafikmängd. Senast gällande mätdata finns att hämta dvs ej historik. Källsystem är PMS-systemen.
  • PavementData 1 - Beläggningsdata från PMS-systemen kombinerat med relevant vägdata från NVDB. Vi kan ej garantera att det är helt aktuellt data från NVDB. Datum för när data hämtades framgår av posten TimeStamp. För att se källa för respektive data, gå till fliken Om variabler i systemet PMSV3.
  • RoadData 1 - Vägdata från NVDB som är relevant tillsammans med PMS-systemens beläggnings och mätdata. Vi kan ej garantera att det är dagsaktuell data från NVDB. Datum för när data hämtades framgår av posten TimeStamp. För att se källa för respektive data, gå till fliken Om variabler i systemet PMSV3.
  • RoadGeometry 1 - Vägens geometri relaterat till det data vi tillhandahåller från PMS-systemen med data om beläggningar och mätdata. Vi kan ej garantera att geometrin är dagsaktuell från NVDB. Datum för när data hämtades framgår av posten TimeStamp.

Code of Conduct

This repository's Code of Conduct can be found here: CODE_OF_CONDUCT.md

License

This project is licensed under the MIT License - see the LICENSE.md file for details. © BloodfallenTear 2019

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 667 7/14/2019
1.1.0 470 7/8/2019
1.0.0 468 7/6/2019
0.31.0 485 7/3/2019
0.30.0 476 6/22/2019
0.29.0 467 6/15/2019
0.28.1 488 6/10/2019
0.27.0 540 6/5/2019
0.25.0 513 6/3/2019
0.23.0 509 5/26/2019
0.16.0 534 5/20/2019
0.13.0 539 5/19/2019
0.12.0 524 5/19/2019
0.10.0 515 5/18/2019
0.8.0 525 5/16/2019
0.6.1.2 505 5/14/2019