Route4MeSDKLibrary 1.0.0.3

There is a newer version of this package available.
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
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="Route4MeSDKLibrary" Version="1.0.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Route4MeSDKLibrary --version 1.0.0.3
#r "nuget: Route4MeSDKLibrary, 1.0.0.3"
#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 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

  1. Create console c# (.net core) project;

  2. Search NuGet for the library Route4MeSDKLibrary and install it in the project;

  3. 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);
            }

        }
    }
}
  1. 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();
        }
    }
}
  1. Run the project. You can expect to get a generated route with the optimized sequence of the destinations.
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.2 is compatible.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.11.0 151 1/31/2024
7.10.0 89 1/29/2024
7.9.0 107 1/16/2024
7.8.4 142 1/4/2024
7.8.3 117 12/22/2023
7.8.2 113 12/21/2023
7.8.1 122 12/18/2023
7.8.0 139 12/15/2023
7.7.5 164 11/21/2023
7.7.4 102 11/17/2023
7.7.3 346 9/7/2023
7.7.2 214 9/6/2023
7.7.1 297 7/14/2023
7.7.0 200 7/4/2023
7.6.0 342 5/23/2023
7.5.3 257 5/5/2023
7.5.2 213 4/20/2023
7.5.1 190 4/19/2023
7.5.0 208 4/14/2023
7.4.2 200 4/6/2023
7.4.1 240 3/9/2023
7.4.0 254 3/6/2023
7.3.0 269 2/23/2023
7.2.3 277 2/8/2023
7.2.2 324 1/13/2023
7.2.1 398 1/11/2023
7.2.0 327 1/11/2023
7.1.0 333 1/11/2023
7.0.0 461 10/6/2022
6.0.0 454 9/2/2022
5.1.1 449 8/29/2022
5.1.0 597 8/26/2022
5.0.0 439 8/23/2022
4.1.0 480 7/29/2022
4.0.0 458 7/15/2022
3.3.0 491 6/30/2022
3.2.0 443 5/11/2022
3.1.0 454 3/2/2022
3.0.1 461 2/23/2022
3.0.0 468 2/9/2022
2.0.0 535 12/16/2021
1.1.3 320 12/14/2021
1.1.2 414 11/19/2021
1.1.1.1 716 11/10/2021
1.1.1 381 11/10/2021
1.0.1.9 381 9/7/2021
1.0.1.8 313 9/1/2021
1.0.1.7 328 8/18/2021
1.0.1.6 349 8/11/2021
1.0.1.3 363 3/29/2021
1.0.1.1 511 1/23/2021
1.0.0.5 534 5/14/2020
1.0.0.4 610 4/2/2020
1.0.0.3 759 12/15/2019
1.0.0.2 644 12/13/2019
1.0.0.1 859 11/29/2019
1.0.0 492 11/28/2019

Changed the type of the AddressNote property 'CustomTypes'
from 'CustomNoteType[]' to 'AddressCustomNote[]'