telemaxx / mapsforgesrv_with_gradle

local mapsforge tileserver
4 stars 4 forks source link

Text not rendered properly #8

Open WIsbrecht opened 4 years ago

WIsbrecht commented 4 years ago

I sometimes encounter badly rendered text. Please find some screenshots attached. Steps to reproduce:

Qmapshack ServerUrl: http://localhost:8080/%1/%2/%3.png?textScale=1.3&userScale=1.0 MapsforgeSrv invocation with Elevate map style version 4.4.1 and this Openandrompas map: http://download.openandromaps.org/mapsV4/Germany/bayern.zip:

java -jar MapsforgeSrv.jar -m bayern_ML.map -t Elements.xml -p 8080 -if localhost -s "elmt-hiking" -o "elmt-acc_allowed-h,elmt-settlements-h,elmt-landscapefeat-h,elmt-borders-h,elmt-amenities-h,elmt-barriers-h,elmt-outdoorsports-h,elmt-emergency-h,elmt-accommodation-h,elmt-restaurants-h,elmt-shops-h,elmt-tourism-h,elmt-buildings-h,elmt-background-h"

I really like this project and appreciate your work.

telemaxx commented 4 years ago

this is an expected behavour and happens, when a label of an object exxeeds the tile borders. the maps are created tile for tile, they did not know what is on the neighboring tile.

inside gps applications, there are eg label caches etc to overcome this. this can not easily solved for the tile server, we must live with this. sorry.

WIsbrecht commented 4 years ago

Thanks for your reply. How come that the first time Qmapshack requests tiles for a particular region all the tiles seem to be alright but then after I clear the cache in Qmapshack and it has to re-request the same tiles, some tiles are bad? I checked this by loading some tiles in the browser. Please see the images that I included. Those are the tiles I get in the browser. Both are the same tiles, but one is ok, the other is not.

telemaxx commented 4 years ago

maybe qms request many tiles at once, and than result depends which tiles is rendered 1st.

WIsbrecht commented 4 years ago

Maybe it's the order in which Qmapshack requests tiles? Is the order of neighboring tiles of importance? Let me check the MapsforgeSrv command line log. EDIT: The order of tiles sure is somewhat different.

Okay, here is the log after a fresh start of MapsforgeSrv for a particular region:

request: Request(GET //localhost:8080/16/35144/22936.png?textScale=1.3&userScale=1.0)@106c7a99 request: Request(GET //localhost:8080/16/35142/22936.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35143/22936.png?textScale=1.3&userScale=1.0)@1e1c95f1 request: Request(GET //localhost:8080/16/35145/22936.png?textScale=1.3&userScale=1.0)@106c7a99 request: Request(GET //localhost:8080/16/35146/22936.png?textScale=1.3&userScale=1.0)@78c79e20 request: Request(GET //localhost:8080/16/35147/22936.png?textScale=1.3&userScale=1.0)@1e1c95f1 request: Request(GET //localhost:8080/16/35148/22936.png?textScale=1.3&userScale=1.0)@1a30ecc2 request: Request(GET //localhost:8080/16/35142/22937.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35143/22937.png?textScale=1.3&userScale=1.0)@78c79e20 request: Request(GET //localhost:8080/16/35144/22937.png?textScale=1.3&userScale=1.0)@106c7a99 request: Request(GET //localhost:8080/16/35145/22937.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35146/22937.png?textScale=1.3&userScale=1.0)@1e1c95f1 request: Request(GET //localhost:8080/16/35147/22937.png?textScale=1.3&userScale=1.0)@1a30ecc2 request: Request(GET //localhost:8080/16/35148/22937.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35142/22938.png?textScale=1.3&userScale=1.0)@106c7a99 request: Request(GET //localhost:8080/16/35143/22938.png?textScale=1.3&userScale=1.0)@78c79e20 request: Request(GET //localhost:8080/16/35144/22938.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35145/22938.png?textScale=1.3&userScale=1.0)@1a30ecc2 request: Request(GET //localhost:8080/16/35146/22938.png?textScale=1.3&userScale=1.0)@1e1c95f1 request: Request(GET //localhost:8080/16/35147/22938.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35142/22938.png?textScale=1.3&userScale=1.0)@b3b9390 request: Request(GET //localhost:8080/16/35143/22938.png?textScale=1.3&userScale=1.0)@78c79e20 request: Request(GET //localhost:8080/16/35145/22938.png?textScale=1.3&userScale=1.0)@106c7a99 request: Request(GET //localhost:8080/16/35146/22938.png?textScale=1.3&userScale=1.0)@b3b9390 request: Request(GET //localhost:8080/16/35147/22938.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35148/22938.png?textScale=1.3&userScale=1.0)@1e1c95f1 request: Request(GET //localhost:8080/16/35142/22939.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35143/22939.png?textScale=1.3&userScale=1.0)@1a30ecc2 request: Request(GET //localhost:8080/16/35144/22939.png?textScale=1.3&userScale=1.0)@b3b9390 request: Request(GET //localhost:8080/16/35145/22939.png?textScale=1.3&userScale=1.0)@106c7a99 request: Request(GET //localhost:8080/16/35146/22939.png?textScale=1.3&userScale=1.0)@78c79e20 request: Request(GET //localhost:8080/16/35147/22939.png?textScale=1.3&userScale=1.0)@106c7a99 request: Request(GET //localhost:8080/16/35148/22939.png?textScale=1.3&userScale=1.0)@b3b9390 request: Request(GET //localhost:8080/16/35142/22940.png?textScale=1.3&userScale=1.0)@1a30ecc2 request: Request(GET //localhost:8080/16/35143/22940.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35144/22940.png?textScale=1.3&userScale=1.0)@1e1c95f1 request: Request(GET //localhost:8080/16/35145/22940.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35146/22940.png?textScale=1.3&userScale=1.0)@1a30ecc2 request: Request(GET //localhost:8080/16/35147/22940.png?textScale=1.3&userScale=1.0)@b3b9390 request: Request(GET //localhost:8080/16/35148/22940.png?textScale=1.3&userScale=1.0)@106c7a99 request: Request(GET //localhost:8080/16/35144/22940.png?textScale=1.3&userScale=1.0)@167e0293 request: Request(GET //localhost:8080/16/35148/22940.png?textScale=1.3&userScale=1.0)@78c79e20

And this is the log for the same region after clearing the cache in QMS:

request: Request(GET //localhost:8080/16/35142/22936.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35144/22936.png?textScale=1.3&userScale=1.0)@6e662237 request: Request(GET //localhost:8080/16/35143/22936.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35146/22936.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35145/22936.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35147/22936.png?textScale=1.3&userScale=1.0)@6e662237 request: Request(GET //localhost:8080/16/35148/22936.png?textScale=1.3&userScale=1.0)@4e19d67b request: Request(GET //localhost:8080/16/35142/22937.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35143/22937.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35144/22937.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35145/22937.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35146/22937.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35147/22937.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35148/22937.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35142/22938.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35143/22938.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35144/22938.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35145/22938.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35146/22938.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35147/22938.png?textScale=1.3&userScale=1.0)@6e662237 request: Request(GET //localhost:8080/16/35148/22938.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35142/22939.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35143/22939.png?textScale=1.3&userScale=1.0)@6e662237 request: Request(GET //localhost:8080/16/35144/22939.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35145/22939.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35146/22939.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35147/22939.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35148/22939.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35142/22940.png?textScale=1.3&userScale=1.0)@6e662237 request: Request(GET //localhost:8080/16/35143/22940.png?textScale=1.3&userScale=1.0)@20e57e34 request: Request(GET //localhost:8080/16/35144/22940.png?textScale=1.3&userScale=1.0)@8cdffeb request: Request(GET //localhost:8080/16/35145/22940.png?textScale=1.3&userScale=1.0)@6e662237 request: Request(GET //localhost:8080/16/35146/22940.png?textScale=1.3&userScale=1.0)@4e19d67b request: Request(GET //localhost:8080/16/35147/22940.png?textScale=1.3&userScale=1.0)@79ef08a9 request: Request(GET //localhost:8080/16/35148/22940.png?textScale=1.3&userScale=1.0)@20e57e34

telemaxx commented 4 years ago

maybe newer tiles overpainting labels from older ones.

some years ago i asked the original author to update the mapsfoge libs. he told me, that he stays at 0.6 because that is working better for this for this purpose. newer versions have different caches etc and could resulting in missing objects.

but for me it was more important that i could use current map- and themefiles. so i upgraded the libs. you can try the older version from the mobac project, but than you need older maps and themes.

WIsbrecht commented 4 years ago

Okay, so you're saying this is a problem with the mapsforge library? Then I'll research in that direction. Thanks. I guess this is relevant: https://github.com/mapsforge/mapsforge/issues/1085 There's this alternative renderer "DirectRenderer". I replaced "DatabaseRenderer" with this other renderer which is supposed to always deliver the same tiles regardless of requesting order. It seems to work.

telemaxx commented 4 years ago

mapsforge/mapsforge#1085 seems to fit.

if you like, you can send me a PR.

WIsbrecht commented 4 years ago

Alas, all's not well. I still encounter tiles without appropriate labels. As far as I know the DirectRenderer will still render some tiles without the correct labels but will deprecate and re-render them later on. I guess because QMS is caching tiles, once a bad tile is served it'll be cached. I'll investigate it some more. If I find a suitable workaround I'll post a PR. The osmdroid project (https://github.com/osmdroid/osmdroid) is also using the DirectRenderer.

telemaxx commented 4 years ago

yesterday i got a patch to switch between the 2 renderers via command line parameter. I merge it today.