JMI.Json.Data 0.4.2403

dotnet add package JMI.Json.Data --version 0.4.2403                
NuGet\Install-Package JMI.Json.Data -Version 0.4.2403                
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="JMI.Json.Data" Version="0.4.2403" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JMI.Json.Data --version 0.4.2403                
#r "nuget: JMI.Json.Data, 0.4.2403"                
#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 JMI.Json.Data as a Cake Addin
#addin nuget:?package=JMI.Json.Data&version=0.4.2403

// Install JMI.Json.Data as a Cake Tool
#tool nuget:?package=JMI.Json.Data&version=0.4.2403                

Json Schema Data Generator

This package contains a very first version of a tool allowing to generate JSON content from a given schema. The initial version is very simple but it should be enriched with upcoming iterations.

GPS Data

This version includes new features to create coherent paths for moving vehicles, cinlduing:

  • regular GPS position following a logical path, between provided start and end points
  • vehicle speed according to the starting point, the end point, time and current position
public interface IGPSDataService
    {
        Task<List<(double lat, double lng)>> GetRoutePoints(GPSCoordinates gpsOrigin, GPSCoordinates gpsDestination);

        Task<RouteResponse> GetRoute(GPSCoordinates gpsOrigin, GPSCoordinates gpsDestination);

        Task<(double lat, double lng)> GetPoint(string address);

        Task<RouteResponseWithCinematicData> GetRouteResponseWithSimulatedCinematicDataAsync(GPSCoordinates origin, GPSCoordinates destination);
    }

The service relies on Azure Maps to calculate the path between two points. So, the related Azure Maps key should be provided in the configuration file.

An extension method configures the IoC/DI for the service.

IoC/DI configuration:


...
var externalMapsServiceSettings = _configurationRoot.GetSection(nameof(ExternalMapsServiceSettings));
_services.AddGPSDataService(externalMapsServiceSettings.Get<ExternalMapsServiceSettings>());
...


appsettings.json

{
  "ExternalMapsServiceSettings": {
    "BaseUrl": "https://atlas.microsoft.com",
    "DirectionsUrl": "route/directions/json",
    "SnapToRoadsUrl": "",
    "SearchUrl": "geocode",
    "ApiKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  }
}

Usage

Get Route Points
...

            var gpsDataService = _serviceProvider.GetRequiredService<IGPSDataService>();

            var origin = await gpsDataService.GetPoint("1600 Amphitheatre Parkway, Mountain View, CA");
            var destination = await gpsDataService.GetPoint("150 Market Street, San Francisco, CA");

            var result = await gpsDataService.GetRoutePoints(
                new Models.GPS.GPSCoordinates
                {
                    Latitude = origin.lat,
                    Longitude = origin.lng
                },
                new Models.GPS.GPSCoordinates
                {
                    Latitude = destination.lat,
                    Longitude = destination.lng
                });
...

Get Route
...

            var gpsDataService = _serviceProvider.GetRequiredService<IGPSDataService>();

            var origin = await gpsDataService.GetPoint("1600 Amphitheatre Parkway, Mountain View, CA");
            var destination = await gpsDataService.GetPoint("150 Market Street, San Francisco, CA");

            var result = await gpsDataService.GetRoute(
                new Models.GPS.GPSCoordinates
                {
                    Latitude = origin.lat,
                    Longitude = origin.lng
                },
                new Models.GPS.GPSCoordinates
                {
                    Latitude = destination.lat,
                    Longitude = destination.lng
                });

...

Get route with simulated cinematic data
...

            var gpsDataService = _serviceProvider.GetRequiredService<IGPSDataService>();

            var origin = await gpsDataService.GetPoint("1600 Amphitheatre Parkway, Mountain View, CA");
            var destination = await gpsDataService.GetPoint("150 Market Street, San Francisco, CA");

            var result = await gpsDataService.GetRouteResponseWithSimulatedCinematicDataAsync(
                new Models.GPS.GPSCoordinates
                {
                    Latitude = origin.lat,
                    Longitude = origin.lng
                },
                new Models.GPS.GPSCoordinates
                {
                    Latitude = destination.lat,
                    Longitude = destination.lng
                });

...
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows 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
0.4.2403 72 1/11/2025
0.4.2125-alpha 154 7/11/2024
0.4.2123-alpha 106 7/9/2024
0.4.2121-alpha 106 7/9/2024
0.3.2009 151 6/14/2024
0.3.7 478 11/18/2023
0.1.5 630 4/30/2023
0.1.4 790 11/23/2022
0.1.3 833 10/30/2022
0.1.2 793 10/16/2022
0.1.1 794 10/16/2022
0.1.0 811 10/16/2022