Registered Member
|
Hi,
I am currently trying to use the MarbleWidget (with Qt). I paint GeoDataLineStrings with the Tessellate parameter, and then, when I zoom +, in the middle of my linestring, it disappears. I really don't understand why. I'm using the openstreetmap map with the mercator projection. This is my widget : This is the maximum zoom level before my lineString disappear This is a screenshot when my line disappears So if you have any ideas... Thanks a lot |
KDE Developer
|
Hi,
It's a known limitation of the current latLonAltBox ("bounding box") determination. When calculating the latLonAltBox of the linestring we only consider the nodes of actual coordinates (i.e. latitude and longitude of London and NYC). The coordinates of the tessellated nodes are not taken into account. This latLonAltBox is then used to determine whether the linestring should be drawn. In your case where you zoom into the linestring north from London Marble compares the latLonAltBox of the linestring with the latLonAltBox of the viewport and concludes that the linestring is not visible and doesn't have to be drawn. A fix for this issue inside the Marble library would be to check during latLonAltBox calculation whether the nodes are tessellated and more than e.g. 2 degrees apart. If they are closer it's very unlikely that this issue occurs in a noticable way and no further action is needed. If the nodes are further apart then we need to use the GeoDataCoordinates' interpolation method to sample latitudes and longitudes in between for a sufficient resolution (about 1 degree should be enough). These sampled values would also be considered for the latLonAltBox calculation. Since latLonAltBox calculation is cached until the lineString changes this costly operation shouldn't affect Marble performance. So we just need someone to write the patch and create tests You can do a small experiment to confirm the description above: if you zoom into the path for latitudes and longitudes between London and NYC the issue will not occur. It only occurs for Latitudes above the highest node (i.e. London in this case) - like shown in your screenshots. So with the current Marble code the only workaround you can do is to ensure that the nodes you pass are close enough (you can interpolate further ones via our GeoDataCoordinates::interpolate() method). If you ensure that the nodes are closer than 2 degrees then the "corner case" you reported shouldn't occur. Or you create a fix for the library code (check the latLonAltBox() implementation inside GeoDataLineString() ...). The biggest amount of work there is with proper testing ... . |
Registered Member
|
Hi tackat, and thanks a lot for your answers.
I am currently trying to test the solution you mentioned. When you say : "f the nodes are further apart then we need to use the GeoDataCoordinates' interpolation method to sample latitudes and longitudes in between for a sufficient resolution (about 1 degree should be enough)". Do you mean that I should use the interpolate method with the "t" parameter from 0 to 1 with a step of 0,001 for example ?? Thanks a lot. |
KDE Developer
|
Yes, that's exactly what I meant
|
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]