opensciencemap / vtm

a vector-tile map library written in java - running on android, desktop and within the browser
GNU Lesser General Public License v3.0
238 stars 176 forks source link

very strange artifacts on map #122

Open stleusc opened 9 years ago

stleusc commented 9 years ago

I attach a few screenshots of what I get. It seems to start at higher zoomlevels... A couple of my users complained about the same. I can provide a link to the used mapsforge map and the location you need to position the map at. Then all you need to do is zoom out to fix the issue and zoom back in for it to come back. screenshot_2014-11-03-18-49-33 1 screenshot_2014-11-03-18-49-38 1 screenshot_2014-11-03-18-50-09 1 screenshot_2014-11-03-18-50-13 1

stleusc commented 9 years ago

I tried USE_MESH_POLY = true just in case that it would fix anything but it does not. The bottom 2 pictures are around zoomlevel 17 and 18. 17 is fine 18 fails in case that helps.

hjanetzek commented 9 years ago

Could be a precision issue in MapDatabase reader or the map data - In case of the MapDatabase... it could need some love - have a look at the end of the file ... patches are would be welcome. But why not just use zoom-max=17 now that it works? :)

stleusc commented 9 years ago

Another screenshot that might help.... I enabled a tile grid showing the outline of the tiles. The artifacts are always within a tile and then 'jump' in the next tile. It also seems like the artifacts are always perfectly parallel to the edge of a tile, never angled. screenshot_2014-11-03-19-17-14 1

stleusc commented 9 years ago

screenshot_2014-11-03-19-22-21 1

stleusc commented 9 years ago

People would not be happy with zoom of 17 ;-) Odd thing is that it's not only the jumps but most of the artifacts are not supposed to be there at all! Is there an easy way to print a list of elements being rendered? I could try to trace it down....

hjanetzek commented 9 years ago

For debugging of rendering with a single(or some) tile I use TileRenderTest in vtm-playground. it lets you easily intercept most stages of tile loading. Still wondering for what you need to load tiles on z=18. The tiles overzoom(tm) to max-zoom of the viewport.

stleusc commented 9 years ago

How can I limit zoom to 17? As long as people can zoom in higher I don't need to load new tiles for the vector maps. Where could I do that?

hjanetzek commented 9 years ago

in MapFileTileSource just change the hardcoded super(0, 18) to something more reasonable :)

hjanetzek commented 9 years ago

One reason for having tiles on 18 atm would to show some POIs starting at that level. Though it would be better to have an option in the rules like fade-scale to specify when symbols should become visible

stleusc commented 9 years ago

Btw. I tried my app in an older version and I did not have the issue. Seems like it got introduced between June and now. I was using the same map file.

stleusc commented 9 years ago

Ok, now I changed the super(0, 18) to super(0, 17)... ...and the issue is mostly! gone.... some of the lines of the very first picture are still present (they were showing up at zoom level <18 before). But the issues that started with zoom > 18 are gone. But now I have a new issue... When I zoom in to the max that I allow then no roads are rendered anymore. As soon as I zoom out just a tiny bit they show up again. Any idea for that? And any idea why changing the max zoom fixes the issue?

hjanetzek commented 9 years ago

yea guess I found the reason for #121, remove the test around line 115 in TileRenderer it doesnt serve any purpose anymore..

stleusc commented 9 years ago

so you say remove: //if (tileZoom > v.pos.zoomLevel + 2 || tileZoom < v.pos.zoomLevel - 4) { // return; //}

stleusc commented 9 years ago

I commented out above lines, no impact on this issue.... But then I see you mention #121 in your comment. What did it have to do with that?

stleusc commented 9 years ago

Ah, ok, removing the lines fixes the disappearing roads at highest zoom level :+1: I still would love to understand the true issue behind this. Cutting down the max zoom fixes it 90% of the times but 17 or 18 are just arbitrary numbers and who knows, the next map fails with 17?!

Is there any explanation and a real fix?

stleusc commented 9 years ago

The lines in the very first image are still present and show up at lower zoom level. But, they fade away if I zoom in far enough (right around zoom 18, likely because of the limit....). So while it seems like we have a partial fix there is still something wrong.

stleusc commented 9 years ago

calling super(0, 14); also removes the artifacts in the first pictures but leads to overall bad looking map. But it gives at least a clue where to start looking. What's also interesting is the fact that in the first image the artifacts are right on tile edges and they only run up to the actual road...