GTiff2Tiles
Analogue of gdal2tiles.py on C#. Currently support only GeoTIFF as input data and creates only EPSG:4326 geodetic tiles on output in tms structure.
Solution is build in VS2019 (16.1.1), .NET Framework 4.7.2, targeting Windows x64 systems.
Table of contents
Table of contents generated with markdown-toc.
Current version
Current stable can be found here: , or on NuGet: .
Information about changes since previous releases can be found in changelog. This project supports SemVer 2.0.0.
Previous versions can be found on releases and branches pages.
Examples
In Examples directory you can find GeoTIFFs for some tests.
GTiff2Tiles.Core
GTiff2Tiles.Core is a core library. Here’s the API documentation.
Library uses 2 different algorithms to create tiles:
- Crop – crops all the zooms from input file;
- Join – crops the lowest zoom from input file and then joins the upper images from built tiles.
Also I should mention, that if your input GeoTIFF is not EPSG:4326, it will be converted by GdalWarp to that projection, and saved in temp directory before cropping tiles.
Dependencies
- GDAL – 2.3.3;
- GDAL.Native – 2.3.3;
- NetVips – 1.1.0-rc2;
- NetVips.Native.win-x64 – 8.8.0-rc3;
- System.Threading.Tasks.Extensions – 4.5.2;
- System.Runtime.CompilerServices.Unsafe – 4.5.2;
GTiff2Tiles.Console
GTiff2Tiles.Console is a console application, that uses methods from core to create tiles.
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 | 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.
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 maximum 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
- GDAL – 2.3.3;
- GDAL.Native – 2.3.3;
- NetVips – 1.1.0-rc2;
- NetVips.Native.win-x64 – 8.8.0-rc3;
- System.Threading.Tasks.Extensions – 4.5.2;
- System.Runtime.CompilerServices.Unsafe – 4.5.2;
- CommandLineParser – 2.5.0;
GTiff2Tiles.GUI
GTiff2Tiles.GUI is a very simple (and ugly!) GUI, that has the same methods and parameters, as GTiff2Tiles.Console.
Dependencies
- GDAL – 2.3.3;
- GDAL.Native – 2.3.3;
- NetVips – 1.1.0-rc2;
- NetVips.Native.win-x64 – 8.8.0-rc3;
- System.Threading.Tasks.Extensions – 4.5.2;
- System.Runtime.CompilerServices.Unsafe – 4.5.2;
- Caliburn.Micro – 3.2.0;
- Ookii.Dialogs.Wpf – 1.0.0;
GTiff2Tiles.Tests
GTiff2Tiles.Tests is a unit test project for GTiff2Tiles.Core.
Dependencies
- GDAL – 2.3.3;
- GDAL.Native – 2.3.3;
- NetVips – 1.1.0-rc2;
- NetVips.Native.win-x64 – 8.8.0-rc3;
- System.Threading.Tasks.Extensions – 4.5.2;
- System.Runtime.CompilerServices.Unsafe – 4.5.2;
- NUnit – 3.12.0;
TODO
You can track, what’s planned to do in future releases on projects page.
Contributing
Feel free to contribute, make forks, change some code, add issues, etc.