-
Notifications
You must be signed in to change notification settings - Fork 78
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
Rendering problem while rotating the map (OSMScout2) #81
Comments
See http://libosmscout.sourceforge.net/documentation/renderprocess/ especially the chapter regarding map characteristics. In case of rotating the map you bounding box for the "to be loaded" data of course increases. Did you take this into account in your code? If your tiles have the dimension a*a than your bounding box may increase up to sqrt(a^2+a^2)! |
This problem is reproducible by OSMScout2. It don't use limits for loaded elements right? It should not happen... |
Right, as you can see in void DBThread::TriggerMapRendering() the bounding box for the data is equal the dimension of the requested map. To fix this currentWidth and currentHeight would have to be extended (IMHO in worst case to sqrt(2*max(currentWidth,currentheight)^2)). You can of course evaluate the concrete angle to make a better guess. Anybody interested to write down the math and supply a tested patch :-)? |
I don't think that lookup bounding box is problem. When you look to Look to this debug outputs:
And with different angle:
Loaded area count is equals (4977) but rendered count is half... (1548 / 634) |
In this case it would also be helpful to have a concrete (geofrabrik) import and the id of the object that is missing on rotation. In above case the id of the river. It is possible that further bounding box specific code (clipping,...) in the renderer does not use the corrected or an unrotated bounding box. Having a reproducer I can see, where data is dropped. |
I still believe that there is a bug in libosmscout regarding this. Likely sound bounding box check or similar is not in line with the rotation. To check this, it would be still helpful to get a concrete example. Ideally reproducable with one of the DrawXXX example (though the do not allow angle input yet) :-/ |
Sorry for my long absence. In the images above also Warsaw and the disappearing river - Vistula. |
It looks like the problem is the visibility of https://www.openstreetmap.org/way/4990573#map=15/52.2206/21.0708 (and other objects). Lets check this and take a look, what is happening in the MapPainter. |
I have taken a look at it yesterday, but it looks like in this case I'm just stupid and do not see the real problem. What I see is, that in case where the object is not rendered the IsAreaVisible() method in the MapPainter returns false for these objects. The reason is, that the transformed on screen coordinates of the bounding box of the object (pixel position) result in rectangle that seems to be not visible. Either there is a bug in the projection code (which I do not see and I'm rather sure is just not there) or the conceptional idea of calcuating the bounding box, calculating the resulting screen positions of the min and max coordinates (including in this case rotating) and afterwards checking of the new (unrotated) rectangle build from the pixel coordinates is partly visible is plain wrong. Anybody who has some time to think this through? |
Hi, Tim. I extracted one problematic area and create test for this issue: We can use it for simple debugging this issue... I will look at it later... |
While rotating the map in demo application OSMScout (Qt, qml), some objects in the map may disappear depending on angle. Below few screenshots for demonstration.
In this case, river and some buildings not rendered in some range of angles.
The text was updated successfully, but these errors were encountered: