From cbde8d418e506eda4aebc04106e094fc7a87f632 Mon Sep 17 00:00:00 2001 From: Gigas002 Date: Wed, 27 Feb 2019 21:00:13 +0300 Subject: [PATCH] Release 1.2.0 --- CHANGELOG.md | 19 ++++++ GTiff2Tiles.Console/Program.cs | 4 +- .../Properties/AssemblyInfo.cs | 4 +- GTiff2Tiles.Core/Enums/DateTimePatterns.cs | 5 -- GTiff2Tiles.Core/Enums/Image/Gdal.cs | 9 +-- GTiff2Tiles.Core/Enums/Image/Image.cs | 8 +-- .../Enums/Image/Interpolations.cs | 4 +- .../Exceptions/Image/GdalException.cs | 4 +- .../Exceptions/Image/ImageException.cs | 4 +- .../Exceptions/Tile/TileException.cs | 4 +- GTiff2Tiles.Core/GTiff2Tiles.Core.csproj | 3 + GTiff2Tiles.Core/Helpers/GdalHelper.cs | 16 ++--- GTiff2Tiles.Core/Helpers/NetVipsHelper.cs | 4 +- GTiff2Tiles.Core/Image/Gdal.cs | 8 +-- GTiff2Tiles.Core/Image/Image.cs | 25 ++------ GTiff2Tiles.Core/Properties/AssemblyInfo.cs | 2 +- GTiff2Tiles.GUI/Properties/AssemblyInfo.cs | 4 +- GTiff2Tiles.GUI/ViewModels/MainViewModel.cs | 4 +- GTiff2Tiles.Tests/Image/ImageTests.cs | 4 +- GTiff2Tiles.Tests/Properties/AssemblyInfo.cs | 2 +- README.md | 64 +++++++++++-------- 21 files changed, 106 insertions(+), 95 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4c77f2c..930cd286 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +# 27.02.2019 - Released 1.2.0 + +Changes since 1.1.0: + +* GenerateTiles methods are now async; +* Use static classes instead of structs; +* Fixed black borders issue; +* Multithreading performance improvements; +* Replaced GeoTransform property with more obvious MinX, MinY, MaxX and MaxY; +* Temp directory is now timestamp and not deleted; +* Exceptions (TileException, GdalException, ImageException); +* A lot of error checking; +* Lots of improvements in Image.Gdal class +* Disabled NetVips console warnings; +* Added convertion of bad tiffs to 4326; +* Rewritten Image.Image constructor; +* Fixed some typos; +* Fixed minor issues; + # 03.02.2019 - Released 1.1.0 Changes since 1.0.0: diff --git a/GTiff2Tiles.Console/Program.cs b/GTiff2Tiles.Console/Program.cs index 9d267532..f837fb75 100644 --- a/GTiff2Tiles.Console/Program.cs +++ b/GTiff2Tiles.Console/Program.cs @@ -103,10 +103,10 @@ private static async Task Main(string[] args) switch (Algorithm) { case Core.Enums.Algorithms.Join: - await inputImage.GenerateTilesByJoining(consoleProgress, ThreadsCount, OutputDirectoryInfo, MinZ, MaxZ); + await inputImage.GenerateTilesByJoining(OutputDirectoryInfo, MinZ, MaxZ, consoleProgress, ThreadsCount); break; case Core.Enums.Algorithms.Crop: - await inputImage.GenerateTilesByCropping(consoleProgress, ThreadsCount, OutputDirectoryInfo, MinZ, MaxZ); + await inputImage.GenerateTilesByCropping(OutputDirectoryInfo, MinZ, MaxZ, consoleProgress, ThreadsCount); break; default: Helpers.ErrorHelper.PrintError("This algorithm is not supported."); diff --git a/GTiff2Tiles.Console/Properties/AssemblyInfo.cs b/GTiff2Tiles.Console/Properties/AssemblyInfo.cs index 09076f7a..4158b591 100644 --- a/GTiff2Tiles.Console/Properties/AssemblyInfo.cs +++ b/GTiff2Tiles.Console/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.2.0.0")] +[assembly: AssemblyFileVersion("1.2.0.0")] diff --git a/GTiff2Tiles.Core/Enums/DateTimePatterns.cs b/GTiff2Tiles.Core/Enums/DateTimePatterns.cs index d6e3fb99..e102ebe2 100644 --- a/GTiff2Tiles.Core/Enums/DateTimePatterns.cs +++ b/GTiff2Tiles.Core/Enums/DateTimePatterns.cs @@ -11,10 +11,5 @@ public static class DateTimePatterns /// yyyyMMddHHmmssfff /// public const string LongWithMs = "yyyyMMddHHmmssfff"; - - /// - /// yyyyMMdd - /// - public const string ShortToDate = "yyyyMMdd"; } } diff --git a/GTiff2Tiles.Core/Enums/Image/Gdal.cs b/GTiff2Tiles.Core/Enums/Image/Gdal.cs index 42b9ac90..a82911d0 100644 --- a/GTiff2Tiles.Core/Enums/Image/Gdal.cs +++ b/GTiff2Tiles.Core/Enums/Image/Gdal.cs @@ -1,7 +1,7 @@ namespace GTiff2Tiles.Core.Enums.Image { /// - /// Static class with Gdal enums. + /// Static class with Gdal constants. /// public static class Gdal { @@ -31,11 +31,6 @@ public static class Gdal /// public const string Byte = "Byte"; - /// - /// EPSG:4326 (WGS84) projection string. - /// - public const string Projection = "AUTHORITY[\"EPSG\",\"4326\"]]"; - #endregion #region GdalWarp @@ -45,7 +40,7 @@ public static class Gdal /// public static readonly string[] RepairTifOptions = { - "-overwrite", "-t_srs", "EPSG:4326", "-co", "TILED=YES", "-multi", /*"-s_srs", "EPSG:3857",*/ "-srcnodata", "0", + "-overwrite", "-t_srs", "EPSG:4326", "-co", "TILED=YES", "-multi", "-srcnodata", "0", "-nosrcalpha", "-dstalpha", "0" }; diff --git a/GTiff2Tiles.Core/Enums/Image/Image.cs b/GTiff2Tiles.Core/Enums/Image/Image.cs index fb97c978..98e795e4 100644 --- a/GTiff2Tiles.Core/Enums/Image/Image.cs +++ b/GTiff2Tiles.Core/Enums/Image/Image.cs @@ -1,18 +1,18 @@ namespace GTiff2Tiles.Core.Enums.Image { /// - /// Image enums. + /// constants. /// - public static class Image + internal static class Image { /// /// Number of bands in output tiles. /// - public const int Bands = 4; + internal const int Bands = 4; /// /// Output tile's size. /// - public const int TileSize = 256; + internal const int TileSize = 256; } } diff --git a/GTiff2Tiles.Core/Enums/Image/Interpolations.cs b/GTiff2Tiles.Core/Enums/Image/Interpolations.cs index d21194de..0efcab26 100644 --- a/GTiff2Tiles.Core/Enums/Image/Interpolations.cs +++ b/GTiff2Tiles.Core/Enums/Image/Interpolations.cs @@ -3,11 +3,11 @@ /// /// Represents the interpolation algorithms. /// - public static class Interpolations + internal static class Interpolations { /// /// Bicubic interpoilation. /// - public const string Bicubic = "bicubic"; + internal const string Bicubic = "bicubic"; } } diff --git a/GTiff2Tiles.Core/Exceptions/Image/GdalException.cs b/GTiff2Tiles.Core/Exceptions/Image/GdalException.cs index be27e985..65292361 100644 --- a/GTiff2Tiles.Core/Exceptions/Image/GdalException.cs +++ b/GTiff2Tiles.Core/Exceptions/Image/GdalException.cs @@ -12,7 +12,7 @@ public class GdalException : Exception /// /// - /// Creates new object with passed error message. + /// Creates new object with passed error message. /// /// Error message. public GdalException(string errorMessage) : base(errorMessage) @@ -20,7 +20,7 @@ public GdalException(string errorMessage) : base(errorMessage) /// /// - /// Creates new object with passed error message + /// Creates new object with passed error message /// and a reference to the inner exception that is the cause of this exception. /// /// Error message. diff --git a/GTiff2Tiles.Core/Exceptions/Image/ImageException.cs b/GTiff2Tiles.Core/Exceptions/Image/ImageException.cs index 6c302946..2079a8c1 100644 --- a/GTiff2Tiles.Core/Exceptions/Image/ImageException.cs +++ b/GTiff2Tiles.Core/Exceptions/Image/ImageException.cs @@ -12,7 +12,7 @@ public class ImageException : Exception /// /// - /// Creates new object with passed error message. + /// Creates new object with passed error message. /// /// Error message. public ImageException(string errorMessage) : base(errorMessage) @@ -20,7 +20,7 @@ public ImageException(string errorMessage) : base(errorMessage) /// /// - /// Creates new object with passed error message + /// Creates new object with passed error message /// and a reference to the inner exception that is the cause of this exception. /// /// Error message. diff --git a/GTiff2Tiles.Core/Exceptions/Tile/TileException.cs b/GTiff2Tiles.Core/Exceptions/Tile/TileException.cs index 0560ab4e..884358d5 100644 --- a/GTiff2Tiles.Core/Exceptions/Tile/TileException.cs +++ b/GTiff2Tiles.Core/Exceptions/Tile/TileException.cs @@ -12,7 +12,7 @@ public class TileException : Exception /// /// - /// Creates new object with passed error message. + /// Creates new object with passed error message. /// /// Error message. public TileException(string errorMessage) : base(errorMessage) @@ -20,7 +20,7 @@ public TileException(string errorMessage) : base(errorMessage) /// /// - /// Creates new object with passed error message + /// Creates new object with passed error message /// and a reference to the inner exception that is the cause of this exception. /// /// Error message. diff --git a/GTiff2Tiles.Core/GTiff2Tiles.Core.csproj b/GTiff2Tiles.Core/GTiff2Tiles.Core.csproj index 1b943bc0..05699221 100644 --- a/GTiff2Tiles.Core/GTiff2Tiles.Core.csproj +++ b/GTiff2Tiles.Core/GTiff2Tiles.Core.csproj @@ -92,6 +92,9 @@ 1.0.7 + + 4.5.2 + 4.5.2 diff --git a/GTiff2Tiles.Core/Helpers/GdalHelper.cs b/GTiff2Tiles.Core/Helpers/GdalHelper.cs index fd69a308..3d927c90 100644 --- a/GTiff2Tiles.Core/Helpers/GdalHelper.cs +++ b/GTiff2Tiles.Core/Helpers/GdalHelper.cs @@ -10,24 +10,24 @@ namespace GTiff2Tiles.Core.Helpers /// /// Class for initializing gdal. Analogue of class. /// - public static class GdalHelper + internal static class GdalHelper { #region Fields and properties /// /// Shows if Ogr drivers are configured. /// - public static bool IsOgrConfigured { get; private set; } + internal static bool IsOgrConfigured { get; private set; } /// /// Shows if Gdal drivers are configured. /// - public static bool IsGdalConfigured { get; private set; } + internal static bool IsGdalConfigured { get; private set; } /// /// Shows, if Gdal's binaries are found and have system paths. /// - public static bool Usable { get; private set; } + internal static bool Usable { get; private set; } #region P/Invoke @@ -115,12 +115,12 @@ private static void PrintDriversGdal() #endregion - #region Public + #region internal /// /// Looks for Gdal's binaries and sets PATHs if needed. /// - public static void Initialize() + internal static void Initialize() { try { @@ -186,7 +186,7 @@ public static void Initialize() /// Configures Ogr. /// /// Make sure to call this method before using Ogr. - public static void ConfigureOgr() + internal static void ConfigureOgr() { if (!Usable) throw new Exception("Can't find Gdal binaries, unable to configure Ogr."); @@ -213,7 +213,7 @@ public static void ConfigureOgr() /// Configures Gdal. /// /// Make sure to call this method before using Gdal. - public static void ConfigureGdal() + internal static void ConfigureGdal() { if (!Usable) throw new Exception("Can't find Gdal binaries, unable to configure Gdal."); diff --git a/GTiff2Tiles.Core/Helpers/NetVipsHelper.cs b/GTiff2Tiles.Core/Helpers/NetVipsHelper.cs index fc8dba0a..6c302ecf 100644 --- a/GTiff2Tiles.Core/Helpers/NetVipsHelper.cs +++ b/GTiff2Tiles.Core/Helpers/NetVipsHelper.cs @@ -5,13 +5,13 @@ namespace GTiff2Tiles.Core.Helpers /// /// Some methods for initializing NetVips. /// - public static class NetVipsHelper + internal static class NetVipsHelper { //todo initialize NetVips location. /// /// Disables NetVips log warnings. /// - public static void DisableLog() => Log.SetLogHandler("VIPS", NetVips.Enums.LogLevelFlags.Warning, (domain, level, message) => { }); + internal static void DisableLog() => Log.SetLogHandler("VIPS", NetVips.Enums.LogLevelFlags.Warning, (domain, level, message) => { }); } } diff --git a/GTiff2Tiles.Core/Image/Gdal.cs b/GTiff2Tiles.Core/Image/Gdal.cs index 5c1ffaa8..e178e8a9 100644 --- a/GTiff2Tiles.Core/Image/Gdal.cs +++ b/GTiff2Tiles.Core/Image/Gdal.cs @@ -190,7 +190,7 @@ private static double[] GetGeoTransform(FileInfo inputFileInfo) #endregion - #region Public + #region Internal /// /// Gets proj4 string of input file. @@ -198,7 +198,7 @@ private static double[] GetGeoTransform(FileInfo inputFileInfo) /// Object of class, representing input file. /// Throws . /// proj4. - public static string GetProj4String(FileInfo inputFileInfo) + internal static string GetProj4String(FileInfo inputFileInfo) { #region Parameters checking @@ -242,7 +242,7 @@ public static string GetProj4String(FileInfo inputFileInfo) /// Raster's height. /// Throws . /// with WGS84 coordinates. - public static (double minX, double minY, double maxX, double maxY) GetImageBorders(FileInfo inputFileInfo, int rasterXSize, int rasterYSize) + internal static (double minX, double minY, double maxX, double maxY) GetImageBorders(FileInfo inputFileInfo, int rasterXSize, int rasterYSize) { #region Parameters checking @@ -271,7 +271,7 @@ public static (double minX, double minY, double maxX, double maxY) GetImageBorde /// Object of class, representing input file. /// Throws . /// with image sizes in pixels. - public static (int rasterXSize, int rasterYSize) GetImageSizes(FileInfo inputFileInfo) + internal static (int rasterXSize, int rasterYSize) GetImageSizes(FileInfo inputFileInfo) { #region Parameters checking. diff --git a/GTiff2Tiles.Core/Image/Image.cs b/GTiff2Tiles.Core/Image/Image.cs index 6098dae3..bd3016c6 100644 --- a/GTiff2Tiles.Core/Image/Image.cs +++ b/GTiff2Tiles.Core/Image/Image.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Threading; using System.Threading.Tasks; using GTiff2Tiles.Core.Exceptions.Image; @@ -676,17 +675,7 @@ private void SetCropProperties(DirectoryInfo outputDirectoryInfo, int minZ, int if (string.IsNullOrWhiteSpace(outputDirectoryInfo.FullName)) throw new ImageException("Output directory path is empty."); - try - { - outputDirectoryInfo.Create(); - } - catch (Exception exception) - { - throw new ImageException("Unable to create output directory.", exception); - } - - if (outputDirectoryInfo.EnumerateFileSystemInfos().Any()) - throw new ImageException("Output directory isn't empty."); + Helpers.CheckHelper.CheckOutputDirectory(outputDirectoryInfo); if (maxZ < minZ) throw new ImageException("Maximum zoom is lesser than minimum zoom."); if (minZ < 0) throw new ImageException("Minimum zoom is lesser than 0."); @@ -727,13 +716,13 @@ private void SetCropProperties(DirectoryInfo outputDirectoryInfo, int minZ, int /// /// Create tiles. Crops input tiff only for lowest zoom and then join the higher ones from it. /// - /// Progress. - /// Threads count. /// Object of class, representing output directory. /// Minimum cropped zoom. /// Maximum cropped zoom. + /// Progress. + /// Threads count. /// - public async ValueTask GenerateTilesByJoining(IProgress progress, int threadsCount, DirectoryInfo outputDirectoryInfo, int minZ, int maxZ) + public async ValueTask GenerateTilesByJoining(DirectoryInfo outputDirectoryInfo, int minZ, int maxZ, IProgress progress, int threadsCount) { #region Parameters checking @@ -762,13 +751,13 @@ public async ValueTask GenerateTilesByJoining(IProgress progress, int th /// /// Crops input tiff for each zoom. /// - /// Progress. - /// Threads count. /// Object of class, representing output directory. /// Minimum cropped zoom. /// Maximum cropped zoom. + /// Progress. + /// Threads count. /// - public async ValueTask GenerateTilesByCropping(IProgress progress, int threadsCount, DirectoryInfo outputDirectoryInfo, int minZ, int maxZ) + public async ValueTask GenerateTilesByCropping(DirectoryInfo outputDirectoryInfo, int minZ, int maxZ, IProgress progress, int threadsCount) { #region Parameters checking diff --git a/GTiff2Tiles.Core/Properties/AssemblyInfo.cs b/GTiff2Tiles.Core/Properties/AssemblyInfo.cs index d1e40ec9..7da9de19 100644 --- a/GTiff2Tiles.Core/Properties/AssemblyInfo.cs +++ b/GTiff2Tiles.Core/Properties/AssemblyInfo.cs @@ -31,4 +31,4 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.*")] +[assembly: AssemblyVersion("1.2.0.*")] diff --git a/GTiff2Tiles.GUI/Properties/AssemblyInfo.cs b/GTiff2Tiles.GUI/Properties/AssemblyInfo.cs index 37fe267b..b2d41b83 100644 --- a/GTiff2Tiles.GUI/Properties/AssemblyInfo.cs +++ b/GTiff2Tiles.GUI/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.2.0.0")] +[assembly: AssemblyFileVersion("1.2.0.0")] diff --git a/GTiff2Tiles.GUI/ViewModels/MainViewModel.cs b/GTiff2Tiles.GUI/ViewModels/MainViewModel.cs index b556b769..85dc49e0 100644 --- a/GTiff2Tiles.GUI/ViewModels/MainViewModel.cs +++ b/GTiff2Tiles.GUI/ViewModels/MainViewModel.cs @@ -287,10 +287,10 @@ public async void StartButton() switch (Algorithm) { case Core.Enums.Algorithms.Join: - await inputImage.GenerateTilesByJoining(progress, ThreadsCount, outputDirectoryInfo, MinZ, MaxZ); + await inputImage.GenerateTilesByJoining(outputDirectoryInfo, MinZ, MaxZ, progress, ThreadsCount); break; case Core.Enums.Algorithms.Crop: - await inputImage.GenerateTilesByCropping(progress, ThreadsCount, outputDirectoryInfo, MinZ, MaxZ); + await inputImage.GenerateTilesByCropping(outputDirectoryInfo, MinZ, MaxZ, progress, ThreadsCount); break; default: Helpers.ErrorHelper.ShowError("This algorithm is not supported.", null); diff --git a/GTiff2Tiles.Tests/Image/ImageTests.cs b/GTiff2Tiles.Tests/Image/ImageTests.cs index 80dda4ea..504e2710 100644 --- a/GTiff2Tiles.Tests/Image/ImageTests.cs +++ b/GTiff2Tiles.Tests/Image/ImageTests.cs @@ -48,7 +48,7 @@ public async Task GenerateTilesByJoining() } //Create Image object and crop tiles. Core.Image.Image image = new Core.Image.Image(inputFileInfo); - await image.GenerateTilesByJoining(progress, Enums.Multithreading.ThreadsCount, outputDirectoryInfo, Enums.Zooms.MinZ, Enums.Zooms.MaxZ); + await image.GenerateTilesByJoining(outputDirectoryInfo, Enums.Zooms.MinZ, Enums.Zooms.MaxZ, progress, Enums.Multithreading.ThreadsCount); } catch (Exception exception) { @@ -93,7 +93,7 @@ public async Task GenerateTilesByCropping() } //Create Image object and crop tiles. Core.Image.Image image = new Core.Image.Image(inputFileInfo); - await image.GenerateTilesByCropping(progress, Enums.Multithreading.ThreadsCount, outputDirectoryInfo, Enums.Zooms.MinZ, Enums.Zooms.MaxZ); + await image.GenerateTilesByCropping(outputDirectoryInfo, Enums.Zooms.MinZ, Enums.Zooms.MaxZ, progress, Enums.Multithreading.ThreadsCount); } catch (Exception exception) { diff --git a/GTiff2Tiles.Tests/Properties/AssemblyInfo.cs b/GTiff2Tiles.Tests/Properties/AssemblyInfo.cs index 79440e8a..3e352654 100644 --- a/GTiff2Tiles.Tests/Properties/AssemblyInfo.cs +++ b/GTiff2Tiles.Tests/Properties/AssemblyInfo.cs @@ -14,4 +14,4 @@ [assembly: Guid("d395133d-7823-42fd-91a9-b52592e6c18a")] -[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.2.0.0")] diff --git a/README.md b/README.md index b6e44875..b0c80aeb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GTIFF2TILES -Analogue of [gdal2tiles.py](https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/scripts/gdal2tiles.py) on C#. Currently support any GEOTIFF, but creates **EPSG:4325** **geodetic** tiles on output in [**tms**](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification) structure. +Analogue of [gdal2tiles.py](https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/scripts/gdal2tiles.py) on C#. Currently support any GEOTIFF, but creates **EPSG:4326** **geodetic** tiles on output in [**tms**](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification) structure. Solution is build in VS2017, .NET Framework 4.7.2, targeting Windows x64 systems. @@ -28,15 +28,19 @@ Table of contents generated with [markdown-toc](http://ecotrust-canada.github.io ## Current version -Current stable can be found here: [![Release](https://img.shields.io/github/release/Gigas002/GTiff2Tiles.svg)](https://github.com/Gigas002/GTiff2Tiles/releases/latest). Information about changes since previous release can be found in [changelog](https://github.com/Gigas002/GTiff2Tiles/blob/master/CHANGELOG.md). +Current stable can be found here: [![Release](https://img.shields.io/github/release/Gigas002/GTiff2Tiles.svg)](https://github.com/Gigas002/GTiff2Tiles/releases/latest), or on NuGet: [![NuGet](https://img.shields.io/nuget/v/GTiff2Tiles.svg)](https://www.nuget.org/packages/GTiff2Tiles/). + +Information about changes since previous releases can be found in [changelog](https://github.com/Gigas002/GTiff2Tiles/blob/master/CHANGELOG.md). This project supports [SemVer 2.0.0](https://semver.org/). + +Previous versions can be found on [releases](https://github.com/Gigas002/GTiff2Tiles/releases) and [branches](https://github.com/Gigas002/GTiff2Tiles/branches) pages. ## Examples -In [Examples](https://github.com/Gigas002/GTiff2Tiles/tree/master/Examples/Input) directory you can find GEOTIFF for some tests. +In [Examples](https://github.com/Gigas002/GTiff2Tiles/tree/master/Examples/Input) directory you can find **GEOTIFF** for some tests. ## GTiff2Tiles.Core -**GTiff2Tiles.Core** is a core library. [Here’s]() (will be some day later) the API. +**GTiff2Tiles.Core** is a core library. [Here’s](https://github.com/Gigas002/GTiff2Tiles/wiki) the API documentation. Library uses 2 different algorithms to create tiles: @@ -59,20 +63,33 @@ Also I should mention, that if your input .tif is not **EPSG:4326**, it will be ### Usage -| Short | Long | Description | Required? | -| :---: | :---------: | :----------------------------------------------------: | :-------: | -| -i | --input | Full path to input file | Yes | -| -o | --output | Full path to output directory | Yes | -| -t | --temp | Full path to temp directory | Yes | -| | --minz | Minimum cropped zoom | Yes | -| | --maxz | Maximum cropped zoom | Yes | -| -a | --algorithm | Algorithm to create tiles. Can be \"join\" or \"crop\" | Yes | -| | --threads | Threads count | No | -| | --version | Current version | | -| | --help | Message about console options | | +| Short | Long | Description | Required? | +| :---: | :---------: | :---------------------------: | :-------: | +| -i | --input | Full path to input file | Yes | +| -o | --output | Full path to output directory | Yes | +| -t | --temp | Full path to temp directory | Yes | +| | --minz | Minimum cropped zoom | Yes | +| | --maxz | Maximum cropped zoom | Yes | +| -a | --algorithm | Algorithm to create tiles | Yes | +| | --threads | Threads count | No | +| | --version | Current version | | +| | --help | Message about console options | | + +## Detailed options description + +**input** is `string`, representing full path to input **GEOTIFF** file. + +**output** is `string`, representing full path to directory, where tiles in tms structure will be created. Should be empty. -**Please, be aware of temp directory parameter, because this directory will be deleted after successful crop of tiles!** +**temp** is `string`, representing full path to temporary directory. Inside will be created directory, which name is a **timestamp** in format `yyyyMMddHHmmssfff`. +**minz** is `int` parameter, representing minimum zoom, which you want to crop. + +**maxz **is `int` parameter, representing minimum zoom, which you want to crop. + +**algorithm** is `string`, representing cropping algorithm. Can be **crop** or **join**. When using **crop**, the input image will be cropped for each zoom. When using **join**, the input image will be cropped for the lowest zoom, and the upper tiles created by joining lowest ones. + +**threads** is `int` parameter, representing threads count. By default (if not set) uses 5 threads. ### Dependencies @@ -85,9 +102,7 @@ Also I should mention, that if your input .tif is not **EPSG:4326**, it will be ## GTiff2Tiles.GUI -**GTiff2Tiles.GUI** is a very simple (and ugly!) GUI, that has the same functions, as **GTiff2Tiles.Console**. - -**Please, be aware that temp directory will be deleted after successful crop of tiles!** +**GTiff2Tiles.GUI** is a very simple (and ugly!) GUI, that has the same methods and parameters, as **GTiff2Tiles.Console**. ### Dependencies @@ -99,11 +114,9 @@ Also I should mention, that if your input .tif is not **EPSG:4326**, it will be - [Caliburn.Micro](https://www.nuget.org/packages/Caliburn.Micro) - 3.2.0; - [Ookii.Dialogs.Wpf](https://www.nuget.org/packages/Ookii.Dialogs.Wpf/) - 1.0.0; -Later I’ll probably make this look better, but first I should write docs for **GTiff2Tiles.Core**… - ## GTiff2Tiles.Tests -**GTiff2Tiles.Tests** is a unit test project for **GTiff2Tiles.Core**. I’ll add support of CI later. +**GTiff2Tiles.Tests** is a unit test project for **GTiff2Tiles.Core**. ### Dependencies @@ -113,11 +126,8 @@ Later I’ll probably make this look better, but first I should write docs for * ## TODO -- Target .Net standard 2.1 as soon as possible; -- Support all functional of original Gdal2Tiles.py script; -- Write docs; -- Add CI; +You can track, what’s planned to do in future releases on [projects](https://github.com/Gigas002/GTiff2Tiles/projects) page. ## Contributing -Feel free to contribute, make forks, change some code, add issues etc. +Feel free to contribute, make forks, change some code, add [issues](https://github.com/Gigas002/GTiff2Tiles/issues), etc.