mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-23 14:31:15 +00:00
275ee1b554
- Introduced new TileProvision settings in appsettings.json, including MaxTilesPerBatch and ProgressEmitIntervalSeconds. - Configured TileProvisionConfig in Program.cs to bind the new settings. - Added gRPC service for RouteTileDelivery in Program.cs to handle tile delivery requests. - Updated SatelliteProvider.Api.csproj to include Grpc.AspNetCore package and added protobuf file for tile provision. - Enhanced AuthenticationServiceCollectionExtensions to handle JWT token extraction from the Authorization header. - Registered additional services in RouteManagementServiceCollectionExtensions for tile processing. These changes enhance the API's capability to manage tile provisioning and delivery efficiently.
20 lines
698 B
C#
20 lines
698 B
C#
using SatelliteProvider.Common.Utils;
|
|
|
|
namespace SatelliteProvider.Services.RouteManagement.TileProvision;
|
|
|
|
public static class TileResolutionHelper
|
|
{
|
|
public static double ResolutionMetersPerPixel(int zoomLevel, double latitude, int tileSizePixels)
|
|
{
|
|
var latRad = latitude * Math.PI / 180.0;
|
|
var metersPerPixel = (GeoUtils.EarthEquatorialCircumferenceMeters * Math.Cos(latRad))
|
|
/ (Math.Pow(2, zoomLevel) * tileSizePixels);
|
|
return metersPerPixel;
|
|
}
|
|
|
|
public static double TileSizeMeters(int zoomLevel, double latitude, int tileSizePixels)
|
|
{
|
|
return ResolutionMetersPerPixel(zoomLevel, latitude, tileSizePixels) * tileSizePixels;
|
|
}
|
|
}
|