zip file for tiles

This commit is contained in:
Anton Martynenko
2025-11-20 12:17:57 +01:00
parent 9048a7b3ec
commit 661396554f
10 changed files with 303 additions and 7 deletions
@@ -0,0 +1,4 @@
ALTER TABLE routes
ADD COLUMN create_tiles_zip BOOLEAN NOT NULL DEFAULT FALSE,
ADD COLUMN tiles_zip_path VARCHAR(500);
@@ -11,9 +11,11 @@ public class RouteEntity
public int TotalPoints { get; set; }
public bool RequestMaps { get; set; }
public bool MapsReady { get; set; }
public bool CreateTilesZip { get; set; }
public string? CsvFilePath { get; set; }
public string? SummaryFilePath { get; set; }
public string? StitchedImagePath { get; set; }
public string? TilesZipPath { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
}
@@ -23,8 +23,10 @@ public class RouteRepository : IRouteRepository
SELECT id, name, description, region_size_meters as RegionSizeMeters,
zoom_level as ZoomLevel, total_distance_meters as TotalDistanceMeters,
total_points as TotalPoints, request_maps as RequestMaps,
maps_ready as MapsReady, csv_file_path as CsvFilePath,
maps_ready as MapsReady, create_tiles_zip as CreateTilesZip,
csv_file_path as CsvFilePath,
summary_file_path as SummaryFilePath, stitched_image_path as StitchedImagePath,
tiles_zip_path as TilesZipPath,
created_at as CreatedAt, updated_at as UpdatedAt
FROM routes
WHERE id = @Id";
@@ -53,12 +55,12 @@ public class RouteRepository : IRouteRepository
const string sql = @"
INSERT INTO routes (id, name, description, region_size_meters, zoom_level,
total_distance_meters, total_points, request_maps, maps_ready,
csv_file_path, summary_file_path, stitched_image_path,
created_at, updated_at)
create_tiles_zip, csv_file_path, summary_file_path, stitched_image_path,
tiles_zip_path, created_at, updated_at)
VALUES (@Id, @Name, @Description, @RegionSizeMeters, @ZoomLevel,
@TotalDistanceMeters, @TotalPoints, @RequestMaps, @MapsReady,
@CsvFilePath, @SummaryFilePath, @StitchedImagePath,
@CreatedAt, @UpdatedAt)
@CreateTilesZip, @CsvFilePath, @SummaryFilePath, @StitchedImagePath,
@TilesZipPath, @CreatedAt, @UpdatedAt)
RETURNING id";
return await connection.ExecuteScalarAsync<Guid>(sql, route);
@@ -90,9 +92,11 @@ public class RouteRepository : IRouteRepository
total_points = @TotalPoints,
request_maps = @RequestMaps,
maps_ready = @MapsReady,
create_tiles_zip = @CreateTilesZip,
csv_file_path = @CsvFilePath,
summary_file_path = @SummaryFilePath,
stitched_image_path = @StitchedImagePath,
tiles_zip_path = @TilesZipPath,
updated_at = @UpdatedAt
WHERE id = @Id";
@@ -146,8 +150,10 @@ public class RouteRepository : IRouteRepository
SELECT id, name, description, region_size_meters as RegionSizeMeters,
zoom_level as ZoomLevel, total_distance_meters as TotalDistanceMeters,
total_points as TotalPoints, request_maps as RequestMaps,
maps_ready as MapsReady, csv_file_path as CsvFilePath,
maps_ready as MapsReady, create_tiles_zip as CreateTilesZip,
csv_file_path as CsvFilePath,
summary_file_path as SummaryFilePath, stitched_image_path as StitchedImagePath,
tiles_zip_path as TilesZipPath,
created_at as CreatedAt, updated_at as UpdatedAt
FROM routes
WHERE request_maps = true AND maps_ready = false";