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
+10
View File
@@ -46,6 +46,9 @@ public class TileService : ITileService
}
var centerPoint = new GeoPoint(latitude, longitude);
_logger.LogInformation("TileService - Downloading tiles for center: Lat={Lat:F12}, Lon={Lon:F12}, Radius={Radius}m, Zoom={Zoom}",
latitude, longitude, sizeMeters / 2, zoomLevel);
var downloadedTiles = await _downloader.GetTilesWithMetadataAsync(
centerPoint,
sizeMeters / 2,
@@ -67,6 +70,10 @@ public class TileService : ITileService
foreach (var downloadedTile in downloadedTiles)
{
var now = DateTime.UtcNow;
_logger.LogInformation("TileService - Preparing to save tile: CenterLat={CenterLat:F12}, CenterLon={CenterLon:F12} from downloader",
downloadedTile.CenterLatitude, downloadedTile.CenterLongitude);
var tileEntity = new TileEntity
{
Id = Guid.NewGuid(),
@@ -83,6 +90,9 @@ public class TileService : ITileService
UpdatedAt = now
};
_logger.LogInformation("TileService - TileEntity before DB insert: Lat={Lat:F12}, Lon={Lon:F12}",
tileEntity.Latitude, tileEntity.Longitude);
await _tileRepository.InsertAsync(tileEntity);
_logger.LogInformation("Saved new tile {Id} at ({Lat:F12}, {Lon:F12}) version {Version}", tileEntity.Id, tileEntity.Latitude, tileEntity.Longitude, currentVersion);
result.Add(MapToMetadata(tileEntity));