Giter Club home page Giter Club logo

gtiff2tiles's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar gigas002 avatar ta-stefans avatar uninjured8149 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gtiff2tiles's Issues

Publish fails

Publishing apps with -p:PublishReadyToRun=true and -p:PublishTrimmed=true creates corrupted binaries sometimes. Take a look at this before releasing.

worldwide image to tiles return a error

Describe the bug
A clear and concise description of what the bug is; Exception text (if there was).

To Reproduce
Describe steps to reproduce the behavior.

If you’re running in IDE, please also specify exact file and string number in it, that throws an Exception.

Input data info
Some info about your input GeoTIFF, causing error, at least projection. Would be better, if you can send gdalinfo screenshot.
Ideally – upload GeoTIFF, that causes the error (you can use e.g. Google Drive to share it, since GitHub has some restrictions to the attachment’s size).

Expected behavior
A clear and concise description of what you expected to happen.

Desktop:

  • OS: [e.g. Windows 10 x64]
  • Version [e.g. 1.2.0.]. Please, also specify here, if you’re building from the source and not using the pre-compiled binaries on releases page.

Additional context
Add any other context about the problem here.

I am try map tiler worldwide image,it is return a error:System.OverflowException:“Arithmetic operation resulted in an overflow.”
the Number big the Int32 max value.

QQ截图20210121150420

Creating Tiles issue

Describe the bug
I want to create tiles of a 4 band geotiff file. i am using the GUI of project. when i enter zoom level 0 to 23. it generates zoom level 23 empty folders in output and gives me following error
"unable to call insert unknown pseudo-tag 65538
insert image must have the same number of bands, or one must be single"

geotiff2tiles

Create other types of tiles

It's not yet 100% planned feature, but it's a good idea to consider creating other kind of tiles (.hmp, .qmt, etc).

Tiles for EPSG:3857

I use gdal2tiles.py to generate tiles in mercator projection, and those tiles fits very well on google map, i want gdal2tiles.py implementation . can you add this feature in your project.

Add more resampling options

Add more resampling options, that NetVips can handle.

  • Add resampling class to enums
  • Add resampling part to Image class
  • Update docs
  • Update usages
  • Update tests

Fix warning AL1073

Warning message: ALINK : warning AL1073: Referenced assembly 'mscorlib.dll' targets a different processor.
I've learned, that it's inner dotnet bug, connected with localization stiff, but still didn't find the way to fix it.
Here's the most recent example I've found about that issue. I tried to add these strings:

<PropertyGroup> 
<TargetFrameworkSDKToolsDirectory Condition=" '$(PlatformTarget)' == 'x64'">$(TargetFrameworkSDKToolsDirectory)\$(PlatformTarget)\
</TargetFrameworkSDKToolsDirectory>
</PropertyGroup>

to .csproj file earlier, when the project was on .NET Framework 4.7.2 and 4.8, and it worked fine, but it doesn't work with .NET Core projects.

Documentation for Core

I personally like the github's wiki style, but still it'd be good to create a file/files with docs for library for offline usage.

Crash while writing output tiles

Unpredictable crash, while writing output tiles in method Image.WriteTile. Exact code:

outputImage = NetVips.Image.Black(Enums.Image.Image.TileSize, Enums.Image.Image.TileSize).NewFromImage(0, 0, 0, 0);

// Insert tile into output image
outputImage = outputImage.Insert(tileImage, writePosX, writePosY);

//This string throws an exception sometimes
outputImage.WriteToFile(outputTileFileInfo.FullName);

Probably caused by NetVips.Native 8.9.0-rc4 binaries, but not 100% sure.

Move to a better license

WTFPL is a great license, but I found something even better.
DBAD
Should replace LICENSE file and all license occurencies in .csproj, etc.

worldwide image to tiles

Hello

I tried to generate Tiles for a single gtiff image covering -180 -90 to 180 90 (Natural Earth II image). Border coordinates are correctely rounded
An exception appears with index generated to be -1 when >= 0 is expected

Did you already tried to generate tiles for a worldwide image? Should it be running?

thanks

BR

Update benchmarks

In order to improve benchmarks results, I'd like to add Gdal2Tiles.exe with multiprocessing ability. I'm very new to Python/PyInstaller, so I couldn't do it by myself (my converted .exe file throws errors, when I try to run it with --processes argument).
So, if you can do this, please, convert gdal2tiles.py to .exe with ability to run in multiprocessing mode and link the binaries for windows here.
And it would be even better, if you'll write how to do this, so I'll be able to always use the latest version of Gdal2Tiles in benchmarks.

P.S.
I tried to add this to gdal2tiles.py (StackOverflow discussion of similar question):

if __name__ == '__main__':
    multiprocessing.freeze_support()

But still, that didn't help.

CI/CD

CD:

  • GitHub Releases (Deploy on Appveyor)
  • GitHub docker image (publish-github-docker.ps1 through AppVeyor script after deploy)
  • GitHub nuget package (Deploy on Appveyor/publish-github-nupkg.ps1)
  • Nuget package (Deploy on Appveyor)
  • Docker image (thorugh dockr hub authorization + Dockerfile)

CI:

GitHub:

  • Build on win
  • Build on linux
  • Unit tests win
  • Unit tests linux

Appveyor:

  • Build on win (fails with net5.0 atm)
  • Build on linux
  • Unit tests win (depends on win build)
  • Unit tests linux

Additional:

  • Use ubuntu 20.04 for GitHub CI
  • Use ubuntu 20.04 for Appveyor CI

Update GUI dependencies for .net core 3.x support

Update the MaterialDesignColors, MaterialDesignThemes, MaterialDesignExtensions and Caliburn.Micro packages to versions with .NET Core 3.0 or higher support.
Currently, the MaterialDesignColors and MaterialDesignThemes are already support .net core 3.0 apps, but MaterialDesignExtensions, dependent on them is still not.
Caliburn.Micro stable version doesn't support targeting .net core either, but alpha version from MyGet does. However, I don't want to target that version of Caliburn.Micro yet, because it'll break offline builds and CI.

  • Update MaterialDesignColors
  • Update MaterialDesignThemes
  • Update MaterialDesignExtensions
  • Update Caliburn.Micro (4.0.105-alpha or higher)

Additional:

  • Consider using Prism instead of Caliburn.Micro (needs lots of tests and some GUI code changes)

Create docker image for console app

I think it's possible, I'll take some time to write DOCKERFILE in the future...

  • Create Dockerfile
  • Create docker image for GTIff2Tiles.Console
  • Run some tests
  • Publish image to docker hub

The image is too small to shrink

Some input images can be too small to shrink on selected levels.
The WriteTile (in Core.Image.Image class) method throws an exception (comes from NetVips:
NetVips.VipsException: 'unable to call reducev reducev: reduce factor too large'
or
NetVips.VipsException: 'unable to call reducev reducev: parameter vshrink not set').
The error happens approximately on 245-290 strings numbers.
Right now the temporary solution is to use join algorithm with higher maxz. I won't be able to make some changes in repo untill mid june (I'm too busy atm with my diploma and work), so that won't be fixed at least until then.

Writing tile stream

Writing tiles as IAsyncEnumerable will be very useful if you want to write tiles directly into database, send somewhere etc.

TileGrid Row issue after zoom 8

The tilegrid after zoom 8 for my image (tiff) which is located near to equator is not correct when refering to the grid at https://tile.gbif.org/ui/4326/.

Lets say for the X: 404, Y:127 at Z:8
The website reference showing 127 but from the TilesMinMax in SetCropProperties method in Image.cs file shows X:404, Y:129 at Z: 8. And it gets increasingly large after that.

I have added these lines in Tile.cs

if (zoom < 8)
{
tilesYs[0] = Convert.ToInt32(Math.Ceiling((90.0 + minY) * Math.Pow(2.0, zoom) / 180.0) - 1.0);
tilesYs[1] = Convert.ToInt32(Math.Ceiling((90.0 + maxY) * Math.Pow(2.0, zoom) / 180.0) - 1.0);
}
else
{
tilesYs[0] = Convert.ToInt32(Math.Ceiling((90.0 + minY) * Math.Pow(2.0, zoom) / 180.0) - 1.0 - (Math.Pow(2.0, 2 + (zoom - 8)) - 2));
tilesYs[1] = Convert.ToInt32(Math.Ceiling((90.0 + maxY) * Math.Pow(2.0, zoom) / 180.0) - 1.0 - (Math.Pow(2.0, 2 + (zoom - 8)) - 2));

            }

and found out the output same as the one from the https://tile.gbif.org/ui/4326/.

But... later on errors are triggered at GeoQuery in Image.cs where after zoom 8 the readPosMinY will reach the maximum Y and therefore lead to readYSize become 0, and trigger error at

NetVips.Image tileImage;
try
{
tileImage = inputImage.Crop(readPosX, readPosY, readXSize, readYSize);
}
catch (Exception exception)
{
throw new ImageException(string.Format(Strings.UnableToCreateTile, tileX, tileY), exception);
}

which is at line 238 in Image.cs

Kindly advise if I miss anything or misunderstood anything regarding this matter.

Thanks a lot.

Improve console options

Some options are clearly not needed to be required (make them optional). These are:

  • Temp directory option (should be created near binary folder by default, path is something like: temp/timestamp (to ms)
  • Algorithm
  • Tms

That issue refers GTiff2Tiles.Console and GTiff2Tiles.Benchmarks projects.

Improve Core architecture

It's needed to improve some architecture stuff in Core, before working on new features, like different profiles. But some minor features I'll make for now.

Then work on improved architecture:
TBD

  • Remove unnecessary methods: Join algorithm is worse at speed, then crop and creates the same tiles, so it's unneeded in future releases
  • Rewrite Tile class?
  • Changes to Enums classes
  • Rewrite Image class?

Add methods to create overview tiles for core

It has been done as GenerateTilesByJoining in 1.4.1, but it was not as efficient, as crop algorithm, so I've removed it.
I think I should return this as Core API only because it can be useful in some cases (requires less RAM big input tiff, since only the lowest level crops from it).

  • Write all the logics for core
  • Write tests
  • Update docs

Add jpg and webp extensions for tiles

Add .webp and .jpg extensions for output tiles. These can be set as additional options, so default should stay .png.

Steps:

  • Add extensions in Enums
  • Modify Core.Image.Image class to take the extensions option
  • Update the docs
  • Add option to Console application, modify the calls of GenerateTiles methods, update docs
  • Add list to select the extensions in GUI application, modify the calls of GenerateTiles methods, update docs
  • Create tests for different tile extensions

NetVips file opening issue

Describe the bug
I want to generate tiles from mosaic, i am passing arguments to console but i got this error
"NetVips is unable to open input image.
An attempt was made to load a program with an incorrect format. (Exception from
HRESULT: 0x8007000B)"

Expected behavior
The expacted behvaiour will be the tiles in output folder

Screenshots
netvips

Desktop (please complete the following information):

  • OS: [Windows 8]

Improve cropping performance

Thanks to upcoming release of libvips 8.10.0 and new packages of NetVips, the Raster.Resize math will be deprecated and the libvips's resize method will work instead of it.
But there's also more things to improve:

  • Replace SemaphoreSlims with Parallel.For with auto number of threads selection;
  • Add Memory property for reading input tif if file is lesser, than (that's a thing to decide) size;
  • Use tile cache instead of full image (see this issue);
  • Remove obsolete Resize and other methods (wating for NetVips.Native 8.10.0+ release);

The upmentioned improvements can lead to 5 times faster cropping performance or even more!

Improve Publish script

Make some more stuff with this script to automate publishing release.

  • Add more command line output about current stage
  • Add windows-only parts (GUI, etc)
  • Remove all .pdb files from publish directories
  • Add additional files in package directories (docs, etc)
  • Create .zip archives
  • Test script on Linux

More tests for Linux build

The applications and tests runs smooth on windows, and appveyor tests are OK, but GitHub actions doesn't work yet.

  • Succesfully build from latest commit on Linux

  • Succesfully run the application on Linux and get good results

It seems like MaxRev.Gdal.LinuxRuntime.Minimal files in directory runtimes/linux-x64/native overrides some of NetVips.Native files there, and that crashes NetVips.

  • Succesfully run tests on Linux and get good results
  • Fix GitHub CI and improve appveyor.yml for linux/windows tests

Repository organization

  • Add Code of conduct;
  • Add Contributing;
  • Add Pull request template;
  • Update issue templates;

Note for future: use milestones with projects (not only projects).

Update tests

Steps:

Tests for following classes:

  • GTiff2Tiles.Core.GdalWorker

Tiles namespace:

  • GTiff2Tiles.Core.Tiles.ITile
  • GTiff2Tiles.Core.Tiles.Tile
  • GTiff2Tiles.Core.Tiles.RasterTile
  • GTiff2Tiles.Core.Tiles.Number

Images namespace:

  • GTiff2Tiles.Core.Images.Size
  • GTiff2Tiles.Core.Images.Band
  • GTiff2Tiles.Core.Images.Area

Helpers namespace:

  • GTiff2Tiles.Core.Helpers.ProgressHelper
  • GTiff2Tiles.Core.Helpers.NetVipsHelper (private)
  • GTiff2Tiles.Core.Helpers.GdalHelper (deleted)
  • GTiff2Tiles.Core.Helpers.CheckHelper

GeoTiffs namespace:

  • GTiff2Tiles.Core.GeoTiffs.IGeoTiff
  • GTiff2Tiles.Core.GeoTiffs.Raster

Exceptions namespace:

  • GTiff2Tiles.Core.Exceptions.RasterException
  • GTiff2Tiles.Core.Exceptions.FileException
  • GTiff2Tiles.Core.Exceptions.DirectoryException

Enums namespace:

  • GTiff2Tiles.Core.Enums.TileExtension
  • GTiff2Tiles.Core.Enums.Interpolation
  • GTiff2Tiles.Core.Enums.CoordinateSystem

Coordinates namespace:

  • GTiff2Tiles.Core.Coordinates.PixelCoordinate (needs more data)
  • GTiff2Tiles.Core.Coordinates.MercatorCoordinate
  • GTiff2Tiles.Core.Coordinates.ICoordinate
  • GTiff2Tiles.Core.Coordinates.GeodeticCoordinate
  • GTiff2Tiles.Core.Coordinates.GeoCoordinate
  • GTiff2Tiles.Core.Coordinates.Coordinate

Constants namespace:

  • GTiff2Tiles.Core.Constants.Proj
  • GTiff2Tiles.Core.Constants.Interpolations (deleted)
  • GTiff2Tiles.Core.Constants.Geodesic
  • GTiff2Tiles.Core.Constants.FileExtensions
  • GTiff2Tiles.Core.Constants.DateTimePatterns

Write tiles to stream

Consider adding this API to core in future. Can be useful when using with server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.