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.
<PackageVersion Include="JMI.Json.Data" Version="0.4.2403" />
                    
Directory.Packages.props
<PackageReference Include="JMI.Json.Data" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version 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.
#addin nuget:?package=JMI.Json.Data&version=0.4.2403
                    
Install as a Cake Addin
#tool nuget:?package=JMI.Json.Data&version=0.4.2403
                    
Install as a Cake Tool

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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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 130 1/11/2025
0.4.2125-alpha 162 7/11/2024
0.4.2123-alpha 112 7/9/2024
0.4.2121-alpha 120 7/9/2024
0.3.2009 169 6/14/2024
0.3.7 489 11/18/2023
0.1.5 651 4/30/2023
0.1.4 815 11/23/2022
0.1.3 861 10/30/2022
0.1.2 819 10/16/2022
0.1.1 821 10/16/2022
0.1.0 839 10/16/2022