-1

I have a huge ECW file that I clipped (qgis>clipper) to smaller GeoTiff and reprojected it(qgis>warp) to WGS 84 and then converted it (qgis>translate) to MBTILES but!

The MBTILES file came out at EPSG: 3857

Later when I tried to reproject it again I got the message:

ERROR 6: Only EPSG:3857 supported on MBTiles dataset 

Any idea How can I get an MBTILES file with WGS 84 projection?

I'm having hard time with tilemill so the preferred solution is not with it

  • 1
    Not possible, otherwise it would not be MBTiles. Can you use GeoPackage instead? It supports all coordinate systems. – user30184 Jun 1 '18 at 8:56
  • I need it so I can use it as an offline map at my fulcrum app on my tablet they state that it only supports mbtiles and has to be WGS 84 which now sound very odd – tristramit Jun 1 '18 at 9:25
1

it's possible just not valid mbtiles and you'll have a hard time finding a mapping client that supports this.. I do this with Reinventing Geospatial's Tiles2GPKG_Parallel.py script and then I flip Y and rename gpkg to mbtiles and then add metadata table. As someone else already stated use OGC GPKG (GeoPackage) it supports any Coordinate System. The Tiles Table is the same other than the Naming Schema is in XYZ instead of TMS.

  • 1
    MapTiler also let's you create mbtiles in different coordinate systems/projections. It also does folder of TMS/XYZ Tiles and GPKG – Jordan Bess Jun 1 '18 at 14:16
  • FLIP Y (ROW) ogrinfo test.gpkg -sql "CREATE VIEW tiles AS SELECT test.zoom_level, tile_column, tm.matrix_height-1-tile_row AS tile_row, tile_data FROM test JOIN gpkg_tile_matrix tm ON test.zoom_level = tm.zoom_level AND tm.table_name = 'test'" – Jordan Bess Jun 1 '18 at 15:09
  • Create Metadata $ ogrinfo test.gpkg -sql "CREATE TABLE metadata(name TEXT, value TEXT)" $ ogrinfo test.gpkg -sql "INSERT INTO metadata VALUES('name', 'my_tileset')" $ ogrinfo test.gpkg -sql "INSERT INTO metadata VALUES('type', 'overlay')" // or 'baselayer' $ ogrinfo test.gpkg -sql "INSERT INTO metadata VALUES('version', '1.1')" $ ogrinfo test.gpkg -sql "INSERT INTO metadata VALUES('description', 'description')" $ ogrinfo test.gpkg -sql "INSERT INTO metadata VALUES('format', 'PNG')" – Jordan Bess Jun 1 '18 at 15:09
  • If you don't have GDAL/OGR installed just do it with SQLite3 or any SQLite Application – Jordan Bess Jun 1 '18 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.