geo fences - wip

This commit is contained in:
Anton Martynenko
2025-11-19 17:26:23 +01:00
parent 5974b0c589
commit d122497b50
22 changed files with 766 additions and 114 deletions
@@ -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();
}
}