Results 1 to 11 of 11

Thread: Converting coordinates system QGraphicScene to Latitude,Lognitude

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: (NEW ??) Converting coordinates system QGraphicScene to Latitude,Lognitude

    Everything will be calculated in scene coordinates, so lat/long.

  2. #2
    Join Date
    Feb 2007
    Posts
    48
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6

    Default Re: Converting coordinates system QGraphicScene to Latitude,Lognitude

    Thanks... let me continue with this new thought... may have to provide you some more code

  3. #3
    Join Date
    Feb 2007
    Posts
    48
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6

    Default Re: (Code attached) Converting coordinates system QGraphicScene to Latitude,Lognitude

    I tried you suggestion and it doesn’t seem to work. I must be missing something in the discussion. I have included my code for the project. Can you help? I attached a zip file.

    Should be able to build it and run (windows). Puts up a map gui and a flight plan gui. Either select a predefined set of points or enter your own., the click on “flying”. The version as is works the way I would expect it to work but it is using pixel per degree conversions instead of scene coordinates. If you change the PIXELFACTOR to 0 then the code will attempt to do the conversion in latitude,longitude.

    Under lat, lon approach I want the reseet the scene parameters with each new set of waypoints and all processing to be based on the lat, lon boundaries.

    Problems I am having are:

    1) It won’t reestablish the scene boundaries every time a new set of waypoints is supplied. (works in the pixel conversion approach).

    2) It won’t o zoom in on the scene with things staying center oriented; everything moves up and out of view, no longer accessable.

    3) Would like the scene mouse double click to return the mouse position in the scene lat, lon.

    4) Would like the scroll drag to work. When I do the mouse double click the scene drag stops working.

    5) Finally when I do this version under Linux, when you zoom in white lines begin to appear. As the object moves across the screen white spacing is left behind. Like some background isn’t updating

    Thanks for help
    Attached Files Attached Files

  4. #4
    Join Date
    Jul 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11
    Thanks
    2

    Default Re: (Code attached) Converting coordinates system QGraphicScene to Latitude,Lognitude

    Hi All,

    Sorry to revive an old thread but I am trying to do the same thing and am a little confused... If I set up my scene as suggested by Master Wysota (90, -180, 180, 360) so I get a conversion to lat/lon coords, but I only want to view
    a very small area, for example a 250nm radius around a given lat/lon point, how do I then have the view "zoom in" to display only that area and maintain the lat/lon coord conversion for that area? I am trying to make a radar/sonar type of
    display using lat/lon points...

    Thank you in advance,
    tim

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: (Code attached) Converting coordinates system QGraphicScene to Latitude,Lognitude

    Calculate the rectangle containing your radar circle (world coordinates), about 6 degrees wide/high, and call QGraphicsView::fitInView()Alternatively, you can call QGraphicsView::centerOn() with the centre point of your radar and then scale to suit.

  6. #6
    Join Date
    Jul 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11
    Thanks
    2

    Default Re: Converting coordinates system QGraphicScene to Latitude,Lognitude

    Hi Chris,

    Thank you for your reply. I will try your suggetion...

    tim

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.