tilemill-project / tilemill

TileMill is a modern map design studio
https://tilemill-project.github.io/tilemill/
BSD 3-Clause "New" or "Revised" License
3.12k stars 527 forks source link

MBTiles Export does't work with tileserver #2726

Closed BenjaminQuandt closed 5 years ago

BenjaminQuandt commented 5 years ago

Describe the bug I used tilemill with openstreetmap-carto to get a MBTiles export that I can use with a tileserver. In Tilemill the Map looks correct. Also my exported MBTiles file don't look that wrong. If I put the file into the tileserver I can select the map but I can't see anything on it. If I take the file from Mapbox, the tileserver will show a map. It looks like my export file is broken. But if i extract it, I get a folder/picture structure that looks good for me.

My Versions

Expected behavior

Installation Method

Additional context

differences between the files

There are 2 options for me

csytsma commented 5 years ago

What tileserver are you using? Have you tried viewing the MBTile file in another viewer?

I’ve noticed that the MBTile files now have more metadata, and don’t work in MapTiler iOS app. But the file still works in other viewers.

Can you send a link to download a sample MBTile file for us to take a look at?

On Aug 23, 2019, at 6:26 AM, Benjamin Quandt notifications@github.com wrote:

Describe the bug I used tilemill with openstreetmap-carto to get a MBTiles export that I can use with a tileserver. In Tilemill the Map looks correct. Also my exported MBTiles file don't look that wrong. If I put the file into the tileserver I can select the map but I can't see anything on it. If I take the file from Mapbox, the tileserver will show a map. It looks like my export file is broken. But if i extract it, I get a folder/picture structure that looks good for me.

My Versions

Ubuntu 18.04 Node Version v8.16.1 "sqlite3": "4.0.6" Expected behavior

Add everything I need to a Project. use Export with: node index.js export project_folder ~/export_path/filename.mbtiles --format=mbtiles --log=log_path --files=MapBox_folder use file in tileserver Installation Method

followed the readme Additional context

The tileserver I use: https://hub.docker.com/r/klokantech/tileserver-gl/ The referance file that works: https://docs.mapbox.com/help/glossary/mbtiles/ differences between the files

images in png format/pbf format metadata --> json There are 2 options for me

fix the file get a different tileserver — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

BenjaminQuandt commented 5 years ago

I use a docker image for the tileserver from here: http://tileserver.org/ | https://hub.docker.com/r/klokantech/tileserver-gl/ The sample file from mapbox do you get from here: https://docs.mapbox.com/help/glossary/mbtiles/

Thanks for the fast reply. If you need more information or my tilemill export file let me know.

csytsma commented 5 years ago

Klokantech makes the tileserver you're using, as well as the MapTiler GeoEditor app I use on iOS, which also fails. When I open my MBTiles file created from current version of TileMill, it opens just fine in other applications though. So I suspect that the latest version of Mapnik has changed something in how the MBTiles format is exported, and klokantech's core services are stumbling when trying to open it.

Can you see any log entries that show errors?

Try running the older version of TileMill (v0.10.x), and see if the MBTiles it exports work in your instance. This has worked for me.

On Aug 23, 2019, at 7:37 AM, Benjamin Quandt notifications@github.com wrote:

I use a docker image for the tileserver from here: http://tileserver.org/ http://tileserver.org/ | https://hub.docker.com/r/klokantech/tileserver-gl/ https://hub.docker.com/r/klokantech/tileserver-gl/ The sample file from mapbox do you get from here: https://docs.mapbox.com/help/glossary/mbtiles/ https://docs.mapbox.com/help/glossary/mbtiles/ Thanks for the fast reply. If you need more information or my tilemill export file let me know.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tilemill-project/tilemill/issues/2726?email_source=notifications&email_token=AAA7ORAAWJUIZRYT2OBMFE3QF7Y2RA5CNFSM4IO7TU6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5AMWPY#issuecomment-524340031, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA7ORBZE4B3HPANX2EYINDQF7Y2RANCNFSM4IO7TU6A.

BenjaminQuandt commented 5 years ago

I can check this on Monday I think. I let you know whan I have news there. You said it opens easy in other applications. Do you have one (link/name) that work out of the box that I can use to check that my file work at all?

csytsma commented 5 years ago

On iOS, I use MBTiles GPS. It's a bit funky UI though.

On MacOS, I use Maptiler Desktop v9.1-1. Which is made by Klokantech, but it works for my MBTiles.

On Aug 23, 2019, at 10:24 AM, Benjamin Quandt notifications@github.com wrote:

I can check this on Monday I think. I let you know whan I have news there. You said it opens easy in other applications. Do you have one (link/name) that work out of the box that I can use to check that my file work at all?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tilemill-project/tilemill/issues/2726?email_source=notifications&email_token=AAA7ORCLJCSCRTVF6WMHDVDQGAMMNA5CNFSM4IO7TU6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5A2PGQ#issuecomment-524396442, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA7ORDSM3JBIVN46UO2ADLQGAMMNANCNFSM4IO7TU6A.

BenjaminQuandt commented 5 years ago

Sorry for my late response. I will use the klokantech/tileserver-php for now. Here I had the Problem that i can't use the mbtiles file. I used mbutils to extract it. This looks like It will work for me.

BenjaminQuandt commented 4 years ago

Hi,

now I solved the Problem and just want to let you know in case other people run into it.

For my rendering i used tilemill with openstreetmap-carto what I linked into the tilemill folder. The rendering worked well, but the mbtiles has a strange metadata json. Here I found a lot of stuff from the project.mml. These Information in the metadata json also contain the database credentials you put in the project.mml.

To solve the Problems i removed the metadata json from the sqlite file. After that it also runs with the tileserver-gl.

csytsma commented 4 years ago

@BenjaminQuandt thanks for following-up. Can you be more specific about which metadata in the json you needed to remove? We could potentially update the export process to not include that data going forward.

BenjaminQuandt commented 4 years ago

I have some trouble to handle the text in there it has 452127characters

The data looks like this: https://pastebin.com/tME6vewW

Here you find some Stylesheet data, layer data, tiles data and grids data. In the Layer data you find a Datasource. Here you have queries that getting the data out of the postgis.

I don't know what exactly caused the problem here but I don't think need anything of this so I droped it all.

netkenny commented 3 years ago

Hello,

I have fixed this myself, by just adding the "format" = "png" in the SQLite metadata table, see here:

image

BenjaminQuandt commented 3 years ago

oh, that's interesting. thank you for letting me know this.

csytsma commented 3 years ago

I determined something similar. The MBTiles file would not load in GaiaGPS. After talking to their tech support, they said the issue is that the format needs to be 'png', can't be png8, png16, png256 or similar. I haven't found yet where in the code it adds that. I fear it may be in Mapnik.