mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 21:46:30 +00:00
f58dd3d04f
lat lon -> geopoint correct location for gps if small keypoints number
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using Azaion.Common.DTO;
|
|
using Azaion.Common.DTO.Config;
|
|
using Azaion.Common.Services;
|
|
using MediatR;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Options;
|
|
using Moq;
|
|
using Xunit;
|
|
|
|
namespace Azaion.Annotator.Test;
|
|
|
|
public class GetTilesTestClass
|
|
{
|
|
[Fact]
|
|
public void TestPath()
|
|
{
|
|
var filename = "./input/images-scaled\\AD000010.tif";
|
|
filename = Path.GetFileName(filename);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task GetTilesTest()
|
|
{
|
|
var services = new ServiceCollection();
|
|
services.AddHttpClient();
|
|
var provider = services.BuildServiceProvider();
|
|
var httpClientFactory = provider.GetService<IHttpClientFactory>()!;
|
|
|
|
var satelliteDownloader = new SatelliteDownloader(Mock.Of<ILogger<SatelliteDownloader>>(), new OptionsWrapper<MapConfig>(new MapConfig
|
|
{
|
|
Service = "GoogleMaps",
|
|
ApiKey = "AIzaSyAXRBDBOskC5QOHG6VJWzmVJwYKcu6WH8k"
|
|
}), new OptionsWrapper<DirectoriesConfig>(new DirectoriesConfig
|
|
{
|
|
GpsSatDirectory = "satelliteMaps"
|
|
}), httpClientFactory, Mock.Of<IMediator>());
|
|
|
|
await satelliteDownloader.GetTiles(new GeoPoint(48.2748909, 37.3834877), 600, 18);
|
|
}
|
|
} |