mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 09:16:39 +00:00
geo fences - wip
This commit is contained in:
@@ -262,6 +262,12 @@ public class GoogleMapsDownloaderV2
|
||||
{
|
||||
var tileCenter = GeoUtils.TileToWorldPos(x, y, zoomLevel);
|
||||
|
||||
if ((x == xMin && y == yMin) || (x == xMax && y == yMax))
|
||||
{
|
||||
_logger.LogInformation("GoogleMapsDownloader - Tile ({X}, {Y}) center calculated: Lat={Lat:F12}, Lon={Lon:F12}",
|
||||
x, y, tileCenter.Lat, tileCenter.Lon);
|
||||
}
|
||||
|
||||
var existingTile = existingTiles.FirstOrDefault(t =>
|
||||
Math.Abs(t.Latitude - tileCenter.Lat) < 0.0001 &&
|
||||
Math.Abs(t.Longitude - tileCenter.Lon) < 0.0001 &&
|
||||
@@ -373,9 +379,7 @@ public class GoogleMapsDownloaderV2
|
||||
int totalTiles,
|
||||
CancellationToken token)
|
||||
{
|
||||
_logger.LogDebug("Tile ({X},{Y}) [{Index}/{Total}]: Waiting for semaphore slot", x, y, tileIndex + 1, totalTiles);
|
||||
await _downloadSemaphore.WaitAsync(token);
|
||||
_logger.LogDebug("Tile ({X},{Y}) [{Index}/{Total}]: Acquired semaphore slot, starting download", x, y, tileIndex + 1, totalTiles);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -451,7 +455,6 @@ public class GoogleMapsDownloaderV2
|
||||
}
|
||||
finally
|
||||
{
|
||||
_logger.LogDebug("Tile ({X},{Y}) [{Index}/{Total}]: Releasing semaphore slot", x, y, tileIndex + 1, totalTiles);
|
||||
_downloadSemaphore.Release();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user