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
I tried to draw a line that connects two points 200 km apart. But one of ends of line was about 7 km to south of the first point, so the line did not pass through the point.
Code fragment:
void CustomMapGraphicsView::updatePointDirection(int id)
{
QPointF location = _matchesManager->getCameraLocation();
QPointF pointLocation = _matchesManager->getPointLocation(id);
MapGraphicsObject* line = new LineObject(location, pointLocation);
scene()->addObject(line);
}
The text was updated successfully, but these errors were encountered:
Thanks for letting me know. When I wrote this library, my use cases never included using such large objects. So I never ran into this. Probably this is a problem with conversion between coordinate spaces while drawing objects...I think I am taking some lazy shortcuts which are not "too bad" at a small/local scale but on a large scale like 200km the errors will become apparent.
I will try to take a look at this soon and see if I can make it work.
Thanks for your quick response. I think that the issue is that information about map projection is hidden in PrivateQGraphicsObject, and LineObject itself knows only its position to paint itself. However both endpoints of the line require map projection.
Spent some time looking at this... might be tricky to make it work in a good way since the framework currently assumes that drawing takes place in East-North-Up coordinates (or rather just East-North since we only do 2D). ENU makes a flat earth assumption... which isn't too horrible over small distances, but of course it breaks down over hundreds of km.
I will think some more about this... let me know if you come up with a good way to handle this (or better yet, submit a pull request 😄 )
I tried to draw a line that connects two points 200 km apart. But one of ends of line was about 7 km to south of the first point, so the line did not pass through the point.
Code fragment:
The text was updated successfully, but these errors were encountered: