mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 09:06:38 +00:00
geo fences - wip
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user