Route4MeSDKLibrary 1.0.0.3
See the version list below for details.
dotnet add package Route4MeSDKLibrary --version 1.0.0.3
NuGet\Install-Package Route4MeSDKLibrary -Version 1.0.0.3
<PackageReference Include="Route4MeSDKLibrary" Version="1.0.0.3" />
paket add Route4MeSDKLibrary --version 1.0.0.3
#r "nuget: Route4MeSDKLibrary, 1.0.0.3"
// Install Route4MeSDKLibrary as a Cake Addin #addin nuget:?package=Route4MeSDKLibrary&version=1.0.0.3 // Install Route4MeSDKLibrary as a Cake Tool #tool nuget:?package=Route4MeSDKLibrary&version=1.0.0.3
Usage Example of the Route4Me C# SDK (.net core)
This simple console c# (.net core) project demonstrates the process of creating a new route with 10 destinations.
The project is done in the Visual Studio 2019.
Project Implementation Steps
Create console c# (.net core) project;
Search NuGet for the library Route4MeSDKLibrary and install it in the project;
Add to the project the file RunExamples.cs with the content:
using System;
using System.Collections.Generic;
using System.Text;
using Route4MeSDK;
using Route4MeSDK.DataTypes;
using Route4MeSDK.QueryTypes;
namespace TestRoute4MeSharpSDKCore
{
public class RunExamples
{
public string c_ApiKey { get; set; }
/// <summary>
/// The example demonstrates the process of creating a new route with 10 destinations.
/// </summary>
public void SingleDriverRoute10Stops()
{
Console.WriteLine("SingleDriverRoute10Stops");
// Create the manager with the api key
Route4MeManager route4Me = new Route4MeManager(c_ApiKey);
// Prepare the addresses
Address[] addresses = new Address[]
{
#region Addresses
new Address() { AddressString = "151 Arbor Way Milledgeville GA 31061",
//indicate that this is a departure stop
//single depot routes can only have one departure depot
IsDepot = true,
//required coordinates for every departure and stop on the route
Latitude = 33.132675170898,
Longitude = -83.244743347168,
//the expected time on site, in seconds. this value is incorporated into the optimization engine
//it also adjusts the estimated and dynamic eta's for a route
Time = 0,
//input as many custom fields as needed, custom data is passed through to mobile devices and to the manifest
CustomFields = new Dictionary<string, string>() {{"color", "red"}, {"size", "huge"}}
},
new Address() { AddressString = "230 Arbor Way Milledgeville GA 31061",
Latitude = 33.129695892334,
Longitude = -83.24577331543,
Time = 0 },
new Address() { AddressString = "148 Bass Rd NE Milledgeville GA 31061",
Latitude = 33.143497,
Longitude = -83.224487,
Time = 0 },
new Address() { AddressString = "117 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude = 33.141784667969,
Longitude = -83.237518310547,
Time = 0 },
new Address() { AddressString = "119 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude = 33.141086578369,
Longitude = -83.238258361816,
Time = 0 },
new Address() { AddressString = "131 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude = 33.142036437988,
Longitude = -83.238845825195,
Time = 0 },
new Address() { AddressString = "138 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude = 33.14307,
Longitude = -83.239334,
Time = 0 },
new Address() { AddressString = "139 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude = 33.142734527588,
Longitude = -83.237442016602,
Time = 0 },
new Address() { AddressString = "145 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude = 33.143871307373,
Longitude = -83.237342834473,
Time = 0 },
new Address() { AddressString = "221 Blake Cir Milledgeville GA 31061",
Latitude = 33.081462860107,
Longitude = -83.208511352539,
Time = 0 }
#endregion
};
// Set parameters
RouteParameters parameters = new RouteParameters();
parameters.AlgorithmType = AlgorithmType.TSP;
parameters.RouteName = "Single Driver Route 10 Stops";
parameters.RouteDate = R4MeUtils.ConvertToUnixTimestamp(DateTime.UtcNow.Date.AddDays(1));
parameters.RouteTime = 60 * 60 * 7;
parameters.Optimize = Optimize.Distance.Description();
parameters.DistanceUnit = DistanceUnit.MI.Description();
parameters.DeviceType = DeviceType.Web.Description();
OptimizationParameters optimizationParameters = new OptimizationParameters()
{
Addresses = addresses,
Parameters = parameters
};
// Run the query
DataObject dataObject = route4Me.RunOptimization(optimizationParameters, out string errorString);
// Check the result
if (dataObject == null)
{
Console.WriteLine("SingleDriverRoute10Stops failed: " + errorString);
}
else
{
Console.WriteLine(dataObject.OptimizationProblemId);
}
}
}
}
- Write in the Program.cs the code:
using System;
namespace TestRoute4MeSharpSDKCore
{
class Program
{
/// <summary>
/// Make sure to replace the 11111111111111111111111111111111 (32 characters) demo API key with your API key.
/// With the demo API key, the Route4Me system provides only limited functionality.
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
RunExamples runExamples = new RunExamples();
runExamples.c_ApiKey = "11111111111111111111111111111111";
runExamples.SingleDriverRoute10Stops();
Console.ReadKey();
}
}
}
- Run the project. You can expect to get a generated route with the optimized sequence of the destinations.
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.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.2
- fastJSON (>= 2.2.4)
- Microsoft.AspNetCore.Http.Connections.Client (>= 1.1.0)
- Microsoft.EntityFrameworkCore (>= 2.2.6)
- Microsoft.EntityFrameworkCore.SqlServer (>= 2.2.6)
- Newtonsoft.Json (>= 12.0.2)
- System.Configuration.ConfigurationManager (>= 4.5.0)
- System.Net.Http.WinHttpHandler (>= 4.5.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Route4MeSDKLibrary:
Package | Downloads |
---|---|
Route4MeDbLibrary
The library enables to create/use different engine databases for consuming Route4Me system. Supported database engines: - MsSql (SqlExpress, LocalDb) - MySql - PostgrSql - SQLite The library is done in the c# (.net core) envirnoment and it's platform-independent. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
7.12.1 | 128 | 8/7/2024 |
7.12.0 | 93 | 8/7/2024 |
7.11.2 | 105 | 7/21/2024 |
7.11.1 | 87 | 7/18/2024 |
7.11.0 | 254 | 1/31/2024 |
7.10.0 | 126 | 1/29/2024 |
7.9.0 | 143 | 1/16/2024 |
7.8.4 | 194 | 1/4/2024 |
7.8.3 | 156 | 12/22/2023 |
7.8.2 | 145 | 12/21/2023 |
7.8.1 | 153 | 12/18/2023 |
7.8.0 | 182 | 12/15/2023 |
7.7.5 | 197 | 11/21/2023 |
7.7.4 | 129 | 11/17/2023 |
7.7.3 | 403 | 9/7/2023 |
7.7.2 | 244 | 9/6/2023 |
7.7.1 | 358 | 7/14/2023 |
7.7.0 | 238 | 7/4/2023 |
7.6.0 | 373 | 5/23/2023 |
7.5.3 | 287 | 5/5/2023 |
7.5.2 | 239 | 4/20/2023 |
7.5.1 | 221 | 4/19/2023 |
7.5.0 | 240 | 4/14/2023 |
7.4.2 | 234 | 4/6/2023 |
7.4.1 | 266 | 3/9/2023 |
7.4.0 | 281 | 3/6/2023 |
7.3.0 | 297 | 2/23/2023 |
7.2.3 | 306 | 2/8/2023 |
7.2.2 | 356 | 1/13/2023 |
7.2.1 | 449 | 1/11/2023 |
7.2.0 | 357 | 1/11/2023 |
7.1.0 | 362 | 1/11/2023 |
7.0.0 | 511 | 10/6/2022 |
6.0.0 | 482 | 9/2/2022 |
5.1.1 | 479 | 8/29/2022 |
5.1.0 | 641 | 8/26/2022 |
5.0.0 | 465 | 8/23/2022 |
4.1.0 | 515 | 7/29/2022 |
4.0.0 | 488 | 7/15/2022 |
3.3.0 | 521 | 6/30/2022 |
3.2.0 | 500 | 5/11/2022 |
3.1.0 | 485 | 3/2/2022 |
3.0.1 | 487 | 2/23/2022 |
3.0.0 | 493 | 2/9/2022 |
2.0.0 | 596 | 12/16/2021 |
1.1.3 | 352 | 12/14/2021 |
1.1.2 | 445 | 11/19/2021 |
1.1.1.1 | 864 | 11/10/2021 |
1.1.1 | 403 | 11/10/2021 |
1.0.1.9 | 411 | 9/7/2021 |
1.0.1.8 | 341 | 9/1/2021 |
1.0.1.7 | 360 | 8/18/2021 |
1.0.1.6 | 384 | 8/11/2021 |
1.0.1.3 | 390 | 3/29/2021 |
1.0.1.1 | 551 | 1/23/2021 |
1.0.0.5 | 561 | 5/14/2020 |
1.0.0.4 | 655 | 4/2/2020 |
1.0.0.3 | 803 | 12/15/2019 |
1.0.0.2 | 683 | 12/13/2019 |
1.0.0.1 | 955 | 11/29/2019 |
1.0.0 | 540 | 11/28/2019 |
Changed the type of the AddressNote property 'CustomTypes'
from 'CustomNoteType[]' to 'AddressCustomNote[]'