Thursday, 16 August 2018

Joining several raster .mbtiles?


I have several .mbtiles with no (or little) overlapping areas and I would like to merge them into one file in order to be able to serve them more easily.



I'm looking for a command line tool that can do this.


tile-join seems to work only on vector tiles. When I run to on my raster tiles it crashes:


tile-join first.mbtiles second .mbtiles -o combined.mbtiles
libc++abi.dylib: libc++abi.dylib: libc++abi.dylib: libc++abi.dylib: libc++abi.dylib: terminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exceptionterminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exceptionterminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exceptionlibc++abi.dylib: terminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exceptionlibc++abi.dylib: terminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exception
Abort trap: 6

gdal_merge.py works on .tiff files but I have .mbtiles as input.


Update:


I managed to convert the .mbtiles to .tiff using


gdal_translate input.mbtiles output.tiff

gdal_translate input2.mbtiles output2.tiff

Then merge them using


gdal_merge.py -co COMPRESS=LZW  *.tiff

This gives me one out.tiff but then how to get a .mbtiles back? goal_translate gives me this error:


gdal_translate -of mbtiles out.tif  out.mbtiles
Input file size is 81920, 81920
0ERROR 6: GDALDriver::Create() ... no create method implemented for this format.


any ideas?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...