Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openmaptiles .mbtiles compatibility #102

Open
marcosox opened this issue Jan 5, 2018 · 7 comments
Open

Openmaptiles .mbtiles compatibility #102

marcosox opened this issue Jan 5, 2018 · 7 comments

Comments

@marcosox
Copy link

marcosox commented Jan 5, 2018

Hello,
I am trying to generate vector mbtiles from an OSM dump to be used with the openmaptiles stack (tileserver-gl) or with tessera, but the server is complaining about the tiles not being in the right format (openmaptiles). I used the config.json and process.lua in the resources/ folder as explained in the readme:

tilemaker --input dataset.osm.pbf --output tiles.mbtiles --config resources/config-openmaptiles.json --process resources/process-openmaptiles.lua

After comparing the DB schema with an OMT sample .mbtiles file, I see that a lot of keys in the metadata table are missing (e.g. bounds, planettime, pixel_scale). the json additional metadata is different and basically the OMT file has 11 tables and 2 views, while the tilemaker generated one has only 2 tables.

How can I generate vector mbtiles in openmaptiles format that can be served by tileserver-gl?

@systemed
Copy link
Owner

systemed commented Jan 5, 2018

Different Mapbox Vector Tiles clients expect different things in the metadata table. You can supply these to tilemaker using the metadata entry under settings in config.json: see https://github.com/systemed/tilemaker/blob/master/CONFIGURATION.md#additional-metadata for details.

Note that the config.json supplied with tilemaker is for demonstration purposes only, it's not really designed for producing a useful map.

This issue is broadly parallel to #82 and a bunch of other stuff over on the Mapbox github, e.g. mapbox/mbtiles-spec#46 . I'm not averse to adding support for specific clients to tilemaker, but I don't want to prat around trying to keep up with 500 forever-changing specs.

@sfkeller, any thoughts?

@systemed
Copy link
Owner

systemed commented Jan 6, 2018

It looks like https://github.com/openmaptiles/openmaptiles-tools has a generate_metadata tool that will generate the metadata that OMT needs.

@marcosox
Copy link
Author

marcosox commented Jan 8, 2018

The generate-metadata tool in openmaptiles-tool simply adds/alters some fields in the metadata table inside the database, but nothing else. DB schema is completely different from openmaptiles and thus, incompatible. Do I understand correctly that playing with the config.json could alter the resulting mbtiles schema and potentially match the OMT one?

@systemed
Copy link
Owner

systemed commented Jan 8, 2018

That surprises me. tilemaker produces vector tiles compliant with the Mapbox Vector Tiles spec and I thought that's what OpenMapTiles understood. I think this will require input from someone who knows about OMT.

@sfkeller
Copy link

sfkeller commented Jan 8, 2018

@marcosox is right: That OMT tool generates several representations of the OMT data schema and serves also e.g. the TileJSON file extended for VT (which is also needed by Mapbox Studio). The specs. extended for VT by MB contains the JSON object "vector_layers" which describes the schema.

@marcosox asked

How can I generate vector mbtiles in openmaptiles format that can be served by tileserver-gl?

To clarify: I assume you are referring to mbtiles metadata table, since tileserver-gl can serve any VT data. I think this is something to ask over at tileserver-gl: http://tileserver.readthedocs.io/en/latest/config.html . /cc @klokan

OMT has a different data schema than MB VT (you know, after MB threatened OSM2VectorTiles, OpenMapTiles has been created with an own schema). I still have hope the mbtiles and TileJSON (metadata) specs. will get some love from MB! /cc 'ing mapbox/mbtiles-spec#46 @flippmoke @ericfischer

@e-n-f
Copy link

e-n-f commented Jan 8, 2018

Thanks @sfkeller. We recognize that the mbtiles and TileJSON specs have been long neglected and inconsistent and plan to get them straightened out soon.

For tilesets served by Mapbox, I still consider mapbox/mbtiles-spec#47 to be the most accurate description: not what the spec really ought to be, perhaps, but what actually works. It would be great to extend that to include what tileserver-gl requires as well.

@carlos-mg89
Copy link

Running this command tilemaker --input dataset.osm.pbf --output tiles.mbtiles --config resources/config-openmaptiles.json --process resources/process-openmaptiles.lua throws tones of errors. While running tilemaker --input dataset.osm.pbf --output tiles.mbtiles throws no error and the generated MBTiles seem to show what they were intended to show.

These are some of the errors I see when running the first command:

Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute name_en if no Layer set
Geometry is empty in OsmLuaProcessing::LayerAsCentroid
Geometry is empty in OsmLuaProcessing::LayerAsCentroid
Geometry is empty in OsmLuaProcessing::LayerAsCentroid
Geometry is empty in OsmLuaProcessing::LayerAsCentroid
Geometry is empty in OsmLuaProcessing::LayerAsCentroid
Geometry is empty in OsmLuaProcessing::LayerAsCentroid
Geometry is empty in OsmLuaProcessing::LayerAsCentroid
Geometry is empty in OsmLuaProcessing::LayerAsCentroid
Can't add Attribute name if no Layer set
Can't add Attribute name_en if no Layer set
Can't add Attribute name_de if no Layer set
Can't add Attribute rank if no Layer set
Can't add Attribute class if no Layer set
Can't add Attribute subclass if no Layer set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants