mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 11:36:38 +00:00
route in progress, region stitching is disabled by default
This commit is contained in:
@@ -34,7 +34,7 @@ public class RegionService : IRegionService
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<RegionStatus> RequestRegionAsync(Guid id, double latitude, double longitude, double sizeMeters, int zoomLevel)
|
||||
public async Task<RegionStatus> RequestRegionAsync(Guid id, double latitude, double longitude, double sizeMeters, int zoomLevel, bool stitchTiles = false)
|
||||
{
|
||||
var now = DateTime.UtcNow;
|
||||
var region = new RegionEntity
|
||||
@@ -44,6 +44,7 @@ public class RegionService : IRegionService
|
||||
Longitude = longitude,
|
||||
SizeMeters = sizeMeters,
|
||||
ZoomLevel = zoomLevel,
|
||||
StitchTiles = stitchTiles,
|
||||
Status = "queued",
|
||||
TilesDownloaded = 0,
|
||||
TilesReused = 0,
|
||||
@@ -59,7 +60,8 @@ public class RegionService : IRegionService
|
||||
Latitude = latitude,
|
||||
Longitude = longitude,
|
||||
SizeMeters = sizeMeters,
|
||||
ZoomLevel = zoomLevel
|
||||
ZoomLevel = zoomLevel,
|
||||
StitchTiles = stitchTiles
|
||||
};
|
||||
|
||||
await _queue.EnqueueAsync(request);
|
||||
@@ -134,12 +136,20 @@ public class RegionService : IRegionService
|
||||
|
||||
var csvPath = Path.Combine(readyDir, $"region_{id}_ready.csv");
|
||||
var summaryPath = Path.Combine(readyDir, $"region_{id}_summary.txt");
|
||||
var stitchedImagePath = Path.Combine(readyDir, $"region_{id}_stitched.jpg");
|
||||
string? stitchedImagePath = null;
|
||||
|
||||
await GenerateCsvFileAsync(csvPath, tiles, linkedCts.Token);
|
||||
|
||||
_logger.LogInformation("Stitching tiles for region {RegionId}", id);
|
||||
await StitchTilesAsync(tiles, region.Latitude, region.Longitude, region.ZoomLevel, stitchedImagePath, linkedCts.Token);
|
||||
if (region.StitchTiles)
|
||||
{
|
||||
stitchedImagePath = Path.Combine(readyDir, $"region_{id}_stitched.jpg");
|
||||
_logger.LogInformation("Stitching tiles for region {RegionId}", id);
|
||||
await StitchTilesAsync(tiles, region.Latitude, region.Longitude, region.ZoomLevel, stitchedImagePath, linkedCts.Token);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogInformation("Skipping tile stitching for region {RegionId}", id);
|
||||
}
|
||||
|
||||
await GenerateSummaryFileAsync(summaryPath, id, region, tiles, tilesDownloaded, tilesReused, stitchedImagePath, processingStartTime, linkedCts.Token, errorMessage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user