Trafikverket.NET
1.1.0
See the version list below for details.
dotnet add package Trafikverket.NET --version 1.1.0
NuGet\Install-Package Trafikverket.NET -Version 1.1.0
<PackageReference Include="Trafikverket.NET" Version="1.1.0" />
paket add Trafikverket.NET --version 1.1.0
#r "nuget: Trafikverket.NET, 1.1.0"
// Install Trafikverket.NET as a Cake Addin #addin nuget:?package=Trafikverket.NET&version=1.1.0 // Install Trafikverket.NET as a Cake Tool #tool nuget:?package=Trafikverket.NET&version=1.1.0
Trafikverket.NET v1.1.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.
Support
This project supports .NET Standard 2.0, .NET Framework 4.5, .NET Framework 4.6 and .NET Framework 4.7.
NuGet
Download the library via NuGet!
Install-Package Trafikverket.NET
Usage
How to create a basic, unfiltered TrainStation request:
Trafikverket Trafikverket = new Trafikverket("Your-Key-Here");
TrainStationResponse TrainStationResponse = Trafikverket.TrainStation.ExecuteRequest();
Console.WriteLine(String.Join(",\r\n", TrainStationResponse.Data.Select(h => h.AdvertisedLocationName)));
Example Ouput: 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 TrafikverketResponse = Trafikverket.ExecuteRequest(new TrafikverketRequest(new Query(ObjectType.TrainAnnouncement, "1")));
Console.WriteLine(String.Join(",\r\n", TrafikverketResponse.TrainAnnouncementResponse[0].Data.Select(x => x.LocationSignature)));
Example Ouput: Hel, Sod, Sol, Sci, [...]
How to create a more advanced, filtered TrainMessage request:
Filter Filter = new Filter();
Filter.AddOperator(new FilterOperator(FilterOperatorType.EQ, "AffectedLocation", "Cst"));
Query Query = new Query(ObjectType.TrainMessage, Trafikverket.SchemaVersions[ObjectType.TrainMessage]);
Query.SetFilter(Filter);
TrafikverketResponse TrafikverketResponse = Trafikverket.ExecuteRequest(new TrafikverketRequest(Query));
Console.WriteLine(String.Join(",\r\n", TrafikverketResponse.TrainMessageResponse[0].Data.Select(x => x.Header)));
Example Ouput: Banarbete, Banarbete, Signalfel, Banarbete, [...]
SchemaVersions Dictionary
To get which Schema Version the library supports, you can access a dictionary located in the 'Trafikverket' class.
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.
Example: String SchemaVersion = Trafikverket.SchemaVersions[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.
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 | Versions 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 | net45 is compatible. net451 was computed. net452 was computed. net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 is compatible. 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. |
-
.NETFramework 4.5
- newtonsoft.json (>= 12.0.2)
- System.Net.Http (>= 4.3.4)
-
.NETFramework 4.6
- newtonsoft.json (>= 12.0.2)
- System.Net.Http (>= 4.3.4)
-
.NETFramework 4.7
- newtonsoft.json (>= 12.0.2)
- System.Net.Http (>= 4.3.4)
-
.NETStandard 2.0
- newtonsoft.json (>= 12.0.2)
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 | 711 | 7/14/2019 |
1.1.0 | 497 | 7/8/2019 |
1.0.0 | 494 | 7/6/2019 |
0.31.0 | 513 | 7/3/2019 |
0.30.0 | 500 | 6/22/2019 |
0.29.0 | 493 | 6/15/2019 |
0.28.1 | 514 | 6/10/2019 |
0.27.0 | 569 | 6/5/2019 |
0.25.0 | 542 | 6/3/2019 |
0.23.0 | 532 | 5/26/2019 |
0.16.0 | 557 | 5/20/2019 |
0.13.0 | 598 | 5/19/2019 |
0.12.0 | 549 | 5/19/2019 |
0.10.0 | 539 | 5/18/2019 |
0.8.0 | 551 | 5/16/2019 |
0.6.1.2 | 529 | 5/14/2019 |