Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Correct empty vector tile / pbf #56

Closed
klokan opened this issue Oct 27, 2015 · 16 comments
Closed

Correct empty vector tile / pbf #56

klokan opened this issue Oct 27, 2015 · 16 comments
Assignees
Milestone

Comments

@klokan
Copy link
Member

klokan commented Oct 27, 2015

The request out of the bounds of vector tiles or not found pbf blobs should respond with a proper empty pbf tile probably... related to existing implementation of vector tiles #42.

@klokan
Copy link
Member Author

klokan commented Dec 14, 2015

In case the MBTiles has in metadata value maskLevel then it should be used instead of default empty vector tile.

See especially comment:
osm2vectortiles/osm2vectortiles#42 (comment)
and other related information at:
osm2vectortiles/osm2vectortiles#89 and
osm2vectortiles/osm2vectortiles#42

@daliborjanak
Copy link
Collaborator

Ok. @klokan have you got some empty tiles or some tip where I could create empty tiles? I will helps me. Mapbox returns 404 not found. Also when is tile inside boundingbox (or geometry) of layer.

@lukasmartinelli
Copy link

This is a tile pyramid from z8 to z14 (8/125/188) that only contains water.

https://drive.google.com/open?id=0B56n5MCkYKPrX1BWelpLYWFvd0U

@daliborjanak
Copy link
Collaborator

@lukasmartinelli thanks, but is water tile really empty? I mean if there is no data?

@lukasmartinelli
Copy link

@lukasmartinelli thanks, but is water tile really empty? I mean if there is no data?

Sorry it's written a bit sloppy. This tile contains the entire subpyramid.

db_browser_for_sqlite_-__users_lukasmartinelli_projects_geometalab_osm2vectortiles_tools_optimize-mbtiles_all_water_mbtiles

But that's actually not what you are interested in.
I removed alls tile below z8 for example.

DELETE FROM map WHERE zoom_level > 8;

Now it just contains one single z8 tile. But if we zoom to e.g. z12 we should still see the same data from z8 if the mask level is set to z8.

db_browser_for_sqlite_-__users_lukasmartinelli_projects_geometalab_osm2vectortiles_tools_optimize-mbtiles_all_water_mbtiles

Uploaded the samples again and gave better names:

@klokan
Copy link
Member Author

klokan commented Dec 14, 2015

@daliborjanak the answer is no - the tile in above water.mbtiles is not empty - it does contain one feature - the water, with standard attributes...

MapBox Hosting does not return an empty tile either it seems - it does return 404 and JSON like:
https://b.tiles.mapbox.com/v4/klokantech.a68116a6/2/0/1.vector.pbf?access_token=tk.eyJ1Ijoia2xva2FudGVjaCIsImV4cCI6MTQ1MDEwNzUwNywiaWF0IjoxNDUwMTAzOTA3LCJzY29wZXMiOlsiZXNzZW50aWFscyIsInNjb3BlczpsaXN0IiwibWFwOnJlYWQiLCJtYXA6d3JpdGUiLCJ1c2VyOnJlYWQiLCJ1c2VyOndyaXRlIiwidXBsb2FkczpyZWFkIiwidXBsb2FkczpsaXN0IiwidXBsb2Fkczp3cml0ZSIsInN0eWxlczpyZWFkIiwiZm9udHM6cmVhZCIsInN0eWxlczp3cml0ZSIsInN0eWxlczpsaXN0Iiwic3R5bGVzOmRyYWZ0IiwiZm9udHM6bGlzdCIsImZvbnRzOndyaXRlIiwiZm9udHM6bWV0YWRhdGEiLCJkYXRhc2V0czpyZWFkIiwiZGF0YXNldHM6d3JpdGUiLCJzdHlsZXM6dGlsZXMiXSwiY2xpZW50IjoibWFwYm94LmNvbSJ9.CLTLCej8AxEumyMjRayurg

I have created a sample dataset, but MapBox Studio Classic does not generate any empty PBF tile (via the symlinks from tiles table) within the bounding box of the tileset at all... tiles seems to be simply missing, if there are no data to render. At least it seems like that.

@lukasmartinelli
Copy link

I have created a sample dataset, but MapBox Studio Classic does not generate any empty PBF tile (via the symlinks from tiles table) within the bounding box of the tileset at all... tiles seems to be simply missing, if there are no data to render. At least it seems like that.

These are vector tiles uploaded from Mapbox Studio Classic? Perhaps these PBFs were never meant for direct serving but always as intermediary format (as Mapbox served raster tiles until last month when the new studio came out) and the raster tile server implements the maskLevel (like tessera does).

But it seems to be the same upload mechanism and upload space as for the new Mapbox Studio MBTiles. Theoretically a Mapbox GL client is able to implement a maskLevel as well.

Configure maskLevel

The maskLevel is set in the MBTiles metadata table as name=maskLevel and for example value=8.

@daliborjanak daliborjanak added this to the 1.1 milestone Jan 25, 2016
@klokan
Copy link
Member Author

klokan commented Feb 26, 2016

@daliborjanak we have deployed the latest version of our recent docker image with tileserver-php behind the CDN and the 404 JSON error messages from commit 3343f80 are still not there:
http://osm2vectortiles-direct.tileserver.com/v1/18/132805/90194.pbf

It has been reported also at:
osm2vectortiles/osm2vectortiles#127

The KlokanTech CDN served from tileserver-mapnik does not have this issue of course:
http://klokantech-direct.tileserver.com/v1/18/132805/90194.pbf?key=SOdXGhtXFm1Q8fAL2rcD

Could you please check why latest docker does not return 404 for non-existing vector tiles and instead still returns an image?

@daliborjanak
Copy link
Collaborator

@klokan I pulled latest container and it works. Returns same as http://labs.klokantech.com/tileserver/#zurich/ol3vector. The problem should be somewhere else

@daliborjanak
Copy link
Collaborator

@klokan, finally 2 bugs: One in docker deploy - it didn't clean cache of downloaded repositories.
Second: Mounted disk contained old version of tileserver.php which overridden tileserver.php in docker. Fixed now.

I also added in tileserver-php ability of config loading from environment. We can now configure tileserver-php via docker volumes which will override config in global $config. We are using it for specifying baseUrl which is server specific. 8bbfa1d

@klokan
Copy link
Member Author

klokan commented Mar 1, 2016

I am still getting at http://osm2vectortiles-direct.tileserver.com/v1/18/132805/90194.pbf an image @o1da!

@o1da
Copy link

o1da commented Mar 1, 2016

It is cache - try it in anonymous mode in chrome

@daliborjanak
Copy link
Collaborator

@klokan cache on -direct? Tile which is lying next to yours returns404: http://osm2vectortiles-direct.tileserver.com/v1/18/132805/90195.pbf

@o1da
Copy link

o1da commented Mar 1, 2016

-direct is without cache, it is cached in the browser, I had same problem, try it in new window, or purge local browser cache.

@klokan
Copy link
Member Author

klokan commented Mar 1, 2016

Ack. Closing osm2vectortiles/osm2vectortiles#127. Thank you!

@klokan
Copy link
Member Author

klokan commented Mar 2, 2016

We return 404 with JSON message now - this seems to be equal to MapBox hosting.

If maskLevel should be really implemented then let's create a new ticket.

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

No branches or pull requests

4 participants