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

Empty tiles after zoom level 12 #355

Closed
kezara opened this issue Nov 14, 2021 · 15 comments
Closed

Empty tiles after zoom level 12 #355

kezara opened this issue Nov 14, 2021 · 15 comments

Comments

@kezara
Copy link

kezara commented Nov 14, 2021

Hello, I've used tilemaker with basic config to make mbtiles of Geofabrik.de extract of Serbia, and I'm not quite sure if it is up to mbtiles renderer that I'm using or it is up to tilemaker, but I have these as a results
Zoom 12:
zoom 12
Zoom 13:
zoom 13
Zoom 14:
zoom 14

Since always the same tiles are missing, I'd say that it's up to tilemaker more than up to mbtiles renderer, but in any case some hints would be very appreciated. Thanks.

@systemed
Copy link
Owner

Could you upload your .mbtiles file somewhere, and say what lat/lon these screenshots are taken at?

@kezara
Copy link
Author

kezara commented Nov 14, 2021

below is screenshot with coordinates for zoom 13
zoom 13 with coordinates
and here is the .mbtiles file.

I saw today that I have empty tiles on few other locations on this map.

@kezara
Copy link
Author

kezara commented Nov 21, 2021

@systemed in the meantime I've done some test with my map presenter and on places where tiles are missing I'm getting null tiles, so I'd say that mbtiles file is, well, corrupted...please give some feedback and advise how to fix this...many thanks...

@systemed
Copy link
Owner

Thanks for checking. I'll take a look as soon as I've got a spare minute. :)

@systemed
Copy link
Owner

Thanks for being patient. :)

I viewed your .mbtiles with tilemaker's demo server (cd server; ruby server.rb ~/path/to/serbia.mbtiles then open localhost:8080) and zoomed into Novi Sad. It looks fine at z13:

Screenshot 2021-11-23 at 13 02 57

So I'm not quite sure what's happening with your screenshots. Two possibilities:

  1. Are you sure you don't have old (empty) tiles cached in your viewer/browser? Mapbox GL can be annoyingly persistent at retaining old tiles. Either your server could send headers that instruct the viewer not to use the cache, or you could try the old hack of attaching a dummy query string parameter (?cdjvhvsdaf) to make it seem like a different document.
  2. Could there be something in these particular tiles that is causing your renderer to fail? My test was with Mapbox GL JS but it's possible that different renderers (or different versions) could have problems, maybe with some of the more complex geometries. If there are any console messages it would be interesting to see them.

@kezara
Copy link
Author

kezara commented Nov 23, 2021

@systemed thanks for feedback...I'm using mbtiles for offline WPF map presentation...it should be small part of the project....for drawing tiles I'm using VectorTileRenderer and I tried it with MapsUI, some custom MapControl and with GMap.Net.
All three presenters have issue with tiles, but first two presenters are showing blurry tiles with lot of pixelation on the same places, and I'm guessing that those are tiles from lower zoom levels, or part of the tiles from lower zoom levels, but with GMap.Net I'm receiving those empty tiles.
In place where VectorTileRenderer returns tile, I'm receiving a null as it can't find it in its provider's dictionary, so I can conclude that VectorTileRenderer doesn't render subject tiles, and I'm not sure why it can't render them...

Are you sure you don't have old (empty) tiles cached in your viewer/browser? Mapbox GL can be annoyingly persistent at retaining old tiles. Either your server could send headers that instruct the viewer not to use the cache, or you could try the old hack of attaching a dummy query string parameter (?cdjvhvsdaf) to make it seem like a different document.

Well, I tried with deleting cache folder, but result is always the same, guess that is the answer to this question

Could there be something in these particular tiles that is causing your renderer to fail? My test was with Mapbox GL JS but it's possible that different renderers (or different versions) could have problems, maybe with some of the more complex geometries. If there are any console messages it would be interesting to see them.

I live in Novi Sad, and as I know and can remember, there is nothing complex here, a few roundabouts, buildings, park here and there, and except Fruska Gora, no uphill or downhill, everything is almost flat...
Except null for tiles I get nothing interesting in console, but I'll double check and try to put some output in places that I think are critical for rendering of mbtiles file.

Again, many thanks for the feedback, I'll come back as soon as I get something useful, and if happens that you figure out something please let me know.

@systemed
Copy link
Owner

I'm guessing that VectorTileRenderer is having an issue with something in those tiles, perhaps a particular polygon, or a missing POI icon in the style. The tiles are certainly present and are being rendered by MBGL. It might be worth extracting the individual .mvt files from the mbtiles using SQLite (remember to invert the Y axis) and attaching them to your issue at AliFlux/VectorTileRenderer#27 for their developers to have a look.

@kezara
Copy link
Author

kezara commented Nov 24, 2021

I'm debugging VectorTileRenderer and for tiles for which I receive null it seems that SQLiteDataReader.Read() returns false...I'm still checking but if I'm calculating Longitude and Latitude well those are the tiles that are missing on the screen...for example I've got null for tile x = 4546 and y = 5252 zoom = 13 and tile x = 4546 and y = 5253 zoom = 13 and in the output in line before null, output shows the following exception Exception thrown: 'System.AggregateException' in System.Private.CoreLib.dll

edit: y tile is transformed by VectorTileRenderer, so for zoom 13, empty tiles are 4546, 2937; 4546, 2938; 4546, 2939 and some more...also my first impression that SQLiteDataReader.Read() returns false, seems that is not true...it's tricky to debug since everything is async...

@kezara
Copy link
Author

kezara commented Nov 25, 2021

I've found breaking point for two missing tiles (but I'm pretty sure that it is the same for the others), it seems that issue is in transportation layer, you can see it on AliFlux/VectorTileRenderer#27,

@systemed
Copy link
Owner

Ah, that's interesting. So it looks like the OMT-compatible script in tilemaker can occasionally adds two attributes with the same key ("class") to one object; Mapbox GL is happy to render that; but VectorTileRenderer isn't.

My guess is that this happens in process-openmaptiles.lua where an object has two "primary" tags, e.g. both a highway and a railway. That should be fixable in the script... I'll take a look.

@kezara
Copy link
Author

kezara commented Nov 25, 2021

Great news, thanks...

@systemed
Copy link
Owner

More complex than I thought, but see if this branch fixes it for you: https://github.com/systemed/tilemaker/commits/dupe_classes

@kezara
Copy link
Author

kezara commented Nov 25, 2021

thanks, but now I have issues with build... when I build as debug I'm getting this

failure

and when I build as release/install I get this

install

With release/install it builds some mbtiles file but with only 20KB and along with it I'm getting mbtiles-journal file, while with debug I'm not getting anything.

Sorry if I'm annoying, but I'm not sure if I'm done something wrong or it's just something in the code...C++ and CMake are unknown territory for me...

@systemed
Copy link
Owner

Windows is unknown territory for me ;)

Try https://www.systemed.net/temp/serbia-test.mbtiles which is generated with that branch.

@kezara
Copy link
Author

kezara commented Nov 25, 2021

thanks a lot, it works...now I'll just have to figure out how to build tilemaker for windows :)


edit:
couldn't build on windows, maybe I'm doing something wrong, don't know, but can build on ubuntu and it works fine, so this issue can be closed

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

2 participants