gigas002 / gtiff2tiles Goto Github PK
View Code? Open in Web Editor NEWAnalogue of gdal2tiles.py/MapTiler on C#.
Home Page: https://gigas002.github.io/GTiff2Tiles/
License: Other
Analogue of gdal2tiles.py/MapTiler on C#.
Home Page: https://gigas002.github.io/GTiff2Tiles/
License: Other
Publishing apps with -p:PublishReadyToRun=true
and -p:PublishTrimmed=true
creates corrupted binaries sometimes. Take a look at this before releasing.
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:
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.
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"
Docs are not created for new record-classes in docfx ver. 2.56.6.
Depends on all core-related issues
It's not yet 100% planned feature, but it's a good idea to consider creating other kind of tiles (.hmp
, .qmt
, etc).
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.
Depends on all issues for Milestone 2.0.0 from Core and Tests projects.
After they're complete, it's safe to update the Console app.
Update these docs before releasing 2.0.0:
Better pre/post-condition checks, excpetion throwing and localization in exceptions
Update docs file for 2.0.0 release.
Add more resampling options, that NetVips can handle.
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.
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.
Also need to simplify some existing, using inheritdoc
Need to add more checks and exceptions for core.
The order is such:
Plus, update dependencies asap (first of all, NetVips.Native to 8.10+, but it would be great to update gdal too)
And if possible:
#43 (moved to future milestone)
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.
WTFPL is a great license, but I found something even better.
DBAD
Should replace LICENSE
file and all license occurencies in .csproj
, etc.
The new System.CommandLine seems like an interesting thing. I'll consider implementing it in place of CommanLineParser package when it'll have stable release.
Use avalonia for GUI app, so it can be cross-platofrm and eliminates MaterialDesign
dependencies
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
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.
Can not generates tilemapresource.xml.
CD:
publish-github-docker.ps1
through AppVeyor script after deploy)publish-github-nupkg.ps1
)CI:
GitHub:
Appveyor:
net5.0
atm)Additional:
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.
Additional:
Depends on all issues for Milestone 2.0.0 from Core and Tests projects.
After they're complete, it's safe to update the GUI app.
I think it's possible, I'll take some time to write DOCKERFILE in the future...
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 tiles as IAsyncEnumerable
will be very useful if you want to write tiles directly into database, send somewhere etc.
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.
Some options are clearly not needed to be required (make them optional). These are:
temp/timestamp (to ms)
That issue refers GTiff2Tiles.Console and GTiff2Tiles.Benchmarks projects.
Depends on #72
According to MaxRev-Dev/gdal.netcore@76b614c#diff-6d6fa00a963a2026bc7d3d2ee4486b1eb68f25bbb6e14b9164de138aca393cde, it's currently impossible to use gdal with libtiff on linux due to some problems with other dependencies. I'll continue using 3.1.2 until this'll be fixed.
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
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).
Why
To implement more functionality of original gdal2tiles.py, that would be good to create an option to make raster tiles too.
Where to start / alternatives
The gdal2tiles.py is a good base point, some maths can be used from it and rewritten on C#.
Also should consider looking at libvips's dzsave.
Why
To implement more functionality of original gdal2tiles.py, that would be good to create an option to make mercator tiles too.
Where to start / alternatives
The gdal2tiles.py is a good base point, some maths can be used from it and rewritten on C#.
Add .webp
and .jpg
extensions for output tiles. These can be set as additional options, so default should stay .png
.
Steps:
Enums
Core.Image.Image
class to take the extensions
optionGenerateTiles
methods, update docsGenerateTiles
methods, update docsDepends on all core-related issues and requires to update the UI as well.
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
Desktop (please complete the following information):
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:
SemaphoreSlim
s with Parallel.For
with auto number of threads selection;Memory
property for reading input tif
if file is lesser, than (that's a thing to decide) size;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!
Make some more stuff with this script to automate publishing release.
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.
Note for future: use milestones with projects (not only projects).
Depends on #28
Steps:
Tests for following classes:
Tiles namespace:
Images namespace:
Helpers namespace:
GeoTiffs namespace:
Exceptions namespace:
Enums namespace:
Coordinates namespace:
Constants namespace:
Consider adding this API to core in future. Can be useful when using with server.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.