mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 22:36:39 +00:00
23 lines
774 B
C#
23 lines
774 B
C#
namespace SatelliteProvider.Common.Configs;
|
|
|
|
public class StorageConfig
|
|
{
|
|
public string TilesDirectory { get; set; } = "/tiles";
|
|
public string ReadyDirectory { get; set; } = "/ready";
|
|
|
|
public string GetTileSubdirectoryPath(int zoomLevel, int tileX, int tileY)
|
|
{
|
|
var xBucket = tileX / 1000;
|
|
var yBucket = tileY / 1000;
|
|
return Path.Combine(TilesDirectory, zoomLevel.ToString(), xBucket.ToString(), yBucket.ToString());
|
|
}
|
|
|
|
public string GetTileFilePath(int zoomLevel, int tileX, int tileY, string timestamp)
|
|
{
|
|
var subdirectory = GetTileSubdirectoryPath(zoomLevel, tileX, tileY);
|
|
var fileName = $"tile_{zoomLevel}_{tileX}_{tileY}_{timestamp}.jpg";
|
|
return Path.Combine(subdirectory, fileName);
|
|
}
|
|
}
|
|
|