You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in this last case, potentially because of a bug - as elements are never removed from tileDependenciesexcept in MapWorkerPool, that we don't want to use because of the display refresh
My suggestion is to create a dedicated class that extends StandardRenderer.
The purpose is to have the same level of quality as DatabaseRenderer, but in a simpler context where we will avoid side-effects.
The name will be something like DirectRenderer.
@devemux86 Oh of course I didn't mean to imply that rasters are better than vectors or that the only point of Mapsforge is to build rasters. Different technology, different usages.
Thanks for your SaveTiles sample. It's more or less what we used to do, and we may encounter the side-effects I described: if we repeatedly ask for the same neighboring tiles, sometimes the labels are not consistent anymore.
Btw I don't seem able to push, I get an error 403. Any idea why? (I'm not a git expert)
@devemux86 Thank you, it works perfectly with the SNAPSHOT version!
Obviously I cannot keep master-SNAPSHOT as a version number for our app (osmdroid) in production.
How does it work from now: when do you plan to create a new version with a real version number?
On our side there's no big hurry on the subject, but I'd like to know when I'm able to merge my fix on osmdroid.
That's what appears in the code but was not part of my initial assumptions: there's no such thing as a unique tile for zoom,x,y in mapsforge.
What you display depends on what you displayed before.
First, display whatever label that overlaps from neighboring tiles and that has been displayed.
Second, display all the labels of the current tile, ordered by priority, and that don't collide with the neighbors' labels.
I guess it can be marginally flawed, e.g. when you already displayed in neighboring tiles unimportant labels that prevent you from displaying an important label on the current tile (because of collision).
Regardless, I guess the whole process is OK if you display maps.
But I display tiles, and here's the additional issue I need to address: taking into account overlapping labels from neighboring tiles that have not been processed yet.
I think that means a third step in my case:
adding all the labels from neighboring tiles that haven't been processed yet
I think your problem is exactly the same.
You say,
But I display *tiles*, and here's the additional issue I need to address:
taking into account overlapping labels from neighboring tiles that have not
been processed yet.
but that means the 'rest of the world', because to know which labels go on
the neighbouring tiles, you will also need to know which labels go on the
tiles neighbouring the neighbours and so on. So, at the end of the day, you
will end up with all the possible labels.
It slightly improves the situation, if you render everything but labels and
labels separately, as we do with the labels layer, then merge the images.
This improves the situation a bit, because the label algorithm will have a
larger area to lay out, so important labels will not be dropped because the
neighbouring tiles have already been rendered. But at a certain point you
will also come to the end of the label-layer area, where you will then face
the same problem again.
On Tue, 11 Sep 2018 at 14:50, monsieurtanuki ***@***.***> wrote:
@ludwigb <https://github.com/ludwigb> Thank you for your comment.
That's what appears in the code but was not part of my initial
assumptions: there's no such thing as a unique tile for zoom,x,y in
mapsforge.
What you display depends on what you displayed before.
First, display whatever label that overlaps from neighboring tiles and
that has been displayed.
Second, display all the labels of the current tile, ordered by priority,
and that don't collide with the neighbors' labels.
I guess it can be marginally flawed, e.g. when you already displayed in
neighboring tiles unimportant labels that prevent you from displaying an
important label on the current tile (because of collision).
Regardless, I guess the whole process is OK if you display *maps*.
But I display *tiles*, and here's the additional issue I need to address:
taking into account overlapping labels from neighboring tiles that have not
been processed yet.
I think that means a third step in my case:
- adding all the labels from neighboring tiles that haven't been
processed yet
- if those labels overlap with the current tile
Or something like that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1085 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACKd_3LQDBZ2Ix7DycX6sQg4bgYbi_Xqks5uZ10-gaJpZM4Wf7iO>
.
I render tile (z,x,y) on the bottom of the screen - I save it as a 256x256 bitmap and put it in my memory cache
I pan downwards and have to display tile (z,x,y+1), that happens to have an overlapping label with the previous tile - I save it as a 256x256 bitmap, including the part of the overlapping label that fits into this tile, and put it in my memory cache
I now have a broken label in my memory cache, partly displayed in tile (z,x,y+1) but not at all displayed in tile (z,x,y) - and that's not good because I display what is in the memory cache - a broken label
I assume that in mapsforge it's not that bad - I assume that first you display tile (z,x,y) without the label, but as soon as you display tile (z,x,y+1) you display fully the label in both tiles. I'm not sure about that, but obviously you don't have this problem in the standard use of mapsforge.
Of course if for some reasons my tiles are not stored in my memory cache anymore, then they will be recomputed and with the tileDependencies mechanism used by mapsforge, the label will appear in both tiles
A solution for me could be to say - if when rendering tile (z,x,y+1) I notice that there's a label that should fit into tile (z,x,y) but was not previously taken into account, then I must "deprecate" the (z,x,y) bitmap and remove it from the memory cache. It will then be recomputed and include the label
Another solution would be to assume that labels don't span over more than 2 neighboring tiles (or that we can live with marginal beyond 2 tiles) and that checking the 8 neighboring tiles' labels is enough
I assume that in mapsforge it's not that bad - I assume that first you display tile (z,x,y) without the label, but as soon as you display tile (z,x,y+1) you display fully the label in both tiles.
No, that doesn't work that way in Mapsforge, the aforementioned forum discussion describes the mechanism.
- A solution for me could be to say - if when rendering tile (z,x,y+1)
I notice that there's a label that should fit into tile (z,x,y) but was not
previously taken into account, then I must "deprecate" the (z,x,y) bitmap
and remove it from the memory cache. It will then be recomputed and include
the label
That also will not work. Because if you then recompute the (z, x, y) tile,
you then will also have to recompute all the tiles adjacent to it, (z,
x+-1, y+-1), as the labels for that tile again depend on its neighbouring
tiles, and so on, ad infinitum...
Vector maps on mobile devices certainly should have variable tile size (like Mapsforge and VTM provide), but the extra tile space does not remove the need for special handling of labels at tile borders.
@devemux86 I agree with you, but in order to implement what I originally had in mind I would have needed to introduce some kind of callbacks into DatabaseRenderer, and I want to have zero impact on it.
Perhaps I will have to add those callbacks anyway (on a copy of DatabaseRenderer?), perhaps I won't have to do it because of the way I manage the cache, so far I don't know.
Activity
devemux86 commentedon Sep 8, 2018
Mapsforge is not meant to be a raster tile generator, there are specific tools for that, like the ones used by all online raster tile providers.
Also Mapsforge offers more advanced real-time rendering of labels + symbols in separate layer, which cannot be written in the raster tiles of the map.
BTW Mapsforge has not any rendering problems via its engine. So cannot know how any external implementations use its low level API correctly or not.
However if someone wants to provide pull request which:
We can certainly review it.
devemux86 commentedon Sep 8, 2018
There is the SaveTiles sample demonstrating similar workflow.
monsieurtanuki commentedon Sep 8, 2018
@devemux86 Oh of course I didn't mean to imply that rasters are better than vectors or that the only point of Mapsforge is to build rasters. Different technology, different usages.
Thanks for your SaveTiles sample. It's more or less what we used to do, and we may encounter the side-effects I described: if we repeatedly ask for the same neighboring tiles, sometimes the labels are not consistent anymore.
Btw I don't seem able to push, I get an error 403. Any idea why? (I'm not a git expert)
devemux86 commentedon Sep 8, 2018
Can check this forum discussion for more details.
Push where?
monsieurtanuki commentedon Sep 8, 2018
Push my commit to mapsforge, in order to create a pull request.
devemux86 commentedon Sep 8, 2018
Only administrators can push commits in Mapsforge repositories. 🙂
Perhaps you can check GitHub documentation about pull requests.
monsieurtanuki commentedon Sep 9, 2018
Looks like I was doing the right thing, but not from the right place.
I've just create the PR #1086.
devemux86 commentedon Sep 9, 2018
Closed via #1086.
devemux86 commentedon Sep 9, 2018
You can use it via snapshot builds published in Sonatype.
monsieurtanuki commentedon Sep 9, 2018
@devemux86 Thank you, it works perfectly with the SNAPSHOT version!
Obviously I cannot keep
master-SNAPSHOTas a version number for our app (osmdroid) in production.How does it work from now: when do you plan to create a new version with a real version number?
On our side there's no big hurry on the subject, but I'd like to know when I'm able to merge my fix on
osmdroid.devemux86 commentedon Sep 9, 2018
Very nice to hear that, please make extensive tests to verify it! 🙂
I can publish a 0.10.1 release, but since we just had 0.10.0, prefer to wait a bit to see if something critical comes up.
monsieurtanuki commentedon Sep 9, 2018
@devemux86 That's fine by me. Just tell me when you're ready, and on our side we keep testing it.
3 remaining items
monsieurtanuki commentedon Sep 11, 2018
@ludwigb Thank you for your comment.
That's what appears in the code but was not part of my initial assumptions: there's no such thing as a unique tile for zoom,x,y in mapsforge.
What you display depends on what you displayed before.
First, display whatever label that overlaps from neighboring tiles and that has been displayed.
Second, display all the labels of the current tile, ordered by priority, and that don't collide with the neighbors' labels.
I guess it can be marginally flawed, e.g. when you already displayed in neighboring tiles unimportant labels that prevent you from displaying an important label on the current tile (because of collision).
Regardless, I guess the whole process is OK if you display maps.
But I display tiles, and here's the additional issue I need to address: taking into account overlapping labels from neighboring tiles that have not been processed yet.
I think that means a third step in my case:
Or something like that.
applantation commentedon Sep 12, 2018
monsieurtanuki commentedon Sep 12, 2018
@ludwigb Here is how my problem is different:
devemux86 commentedon Sep 12, 2018
No, that doesn't work that way in Mapsforge, the aforementioned forum discussion describes the mechanism.
ludwigb commentedon Sep 12, 2018
monsieurtanuki commentedon Sep 12, 2018
@ludwigb I'm more optimistic than you for 2 reasons:
I'll let you know how things evolve.
monsieurtanuki commentedon Sep 19, 2018
Could be somehow solved by osmdroid/osmdroid#1156.
devemux86 commentedon Sep 19, 2018
Vector maps on mobile devices certainly should have variable tile size (like Mapsforge and VTM provide), but the extra tile space does not remove the need for special handling of labels at tile borders.
monsieurtanuki commentedon Sep 19, 2018
@devemux86 I agree with you, but in order to implement what I originally had in mind I would have needed to introduce some kind of callbacks into
DatabaseRenderer, and I want to have zero impact on it.Perhaps I will have to add those callbacks anyway (on a copy of
DatabaseRenderer?), perhaps I won't have to do it because of the way I manage the cache, so far I don't know.devemux86 commentedon Sep 19, 2018
New
DirectRendereris meant for changes and external use, being in same package with similar access.DatabaseRendererin not used externally, remains for library purposes and should avoid changes.feature/mapsforge#1085 - being able to render tile by tile (mapsforge…
Merge branch 'master' into feature/mapsforge#1085
monsieurtanuki commentedon Sep 24, 2018
Just PR'ed #1089
The solution I implemented is a refresh of all neighboring tiles whenever there are new overlapping labels.
Merge remote-tracking branch 'origin/feature/mapsforge#1085' into fea…
feature/#1085 - being able to render tile by tile (#1089)