Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtLocation with custom map
QtWS25 Last Chance

QtLocation with custom map

Scheduled Pinned Locked Moved General and Desktop
9 Posts 5 Posters 2.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marek
    wrote on last edited by
    #1

    Hi,

    Is there something in Qt Location module which could work with custom map (Mercator projected) and convert gps coord BLH to cartezian xyz on a given map. So basicaly convert lat long to pixels x/y on a custom map (lat/long of the cornes are given)

    Best Regards
    Marek

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I may be wrong but that likely would require a custom plugin.

      I'd recommend asking this on the interest mailing list. You'll find there QtLocation's developers/maintainers.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      kshegunovK 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        I may be wrong but that likely would require a custom plugin.

        I'd recommend asking this on the interest mailing list. You'll find there QtLocation's developers/maintainers.

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #3

        @SGaist said in QtLocation with custom map:

        I may be wrong but that likely would require a custom plugin.

        You're not wrong. I've researched it recently and it appears the only way is to write your own plugin.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        0
        • L Offline
          L Offline
          ldanzinger
          wrote on last edited by
          #4

          You could look into the ArcGIS Runtime SDK for Qt. This is a 3rd party API outside of Qt Location, and there is extensive support for many different coordinate systems and data conversions (among many other things)- https://developers.arcgis.com/qt/latest/qml/guide/spatial-references.htm

          1 Reply Last reply
          1
          • M Offline
            M Offline
            Marek
            wrote on last edited by
            #5

            Thanks for that link.
            I have written some functions to convert from spherical GPS to flat x,y with Mercator projection, but this link may be very usefulf.

            Best Regards
            Marek

            1 Reply Last reply
            0
            • BuckwheatB Offline
              BuckwheatB Offline
              Buckwheat
              wrote on last edited by
              #6

              @Marek, also look at GDAL (www.gdal.org) as it does a whole host of geospatial referencing using WKT. There are literally thousands of pre-defined projects available for use.

              Dave Fileccia

              1 Reply Last reply
              1
              • M Offline
                M Offline
                Marek
                wrote on last edited by
                #7

                atually I had this problem:
                I have a rectangle map of a small area (1km), map is not facing north, so when I get GPS coordinates of the four corners they don't make rectangle with right angles but some rhomboid figure. I thought that after applying mercator equation to GPS coordinates It will translate this to rectangle with right angles so I can have rect piece of map (x,y in pixels) and rect gps data that I can compare, but again mercator produced rhomboid figure just in different coordinates. Finally I had to write some mathematical function to translate rhomboid (gps coordinates) to rectangle and then compare translated gps data to rectangle image (in pixels).
                Is this a common problem with gps data and piece of map not facing the north ?

                kshegunovK BuckwheatB 2 Replies Last reply
                0
                • M Marek

                  atually I had this problem:
                  I have a rectangle map of a small area (1km), map is not facing north, so when I get GPS coordinates of the four corners they don't make rectangle with right angles but some rhomboid figure. I thought that after applying mercator equation to GPS coordinates It will translate this to rectangle with right angles so I can have rect piece of map (x,y in pixels) and rect gps data that I can compare, but again mercator produced rhomboid figure just in different coordinates. Finally I had to write some mathematical function to translate rhomboid (gps coordinates) to rectangle and then compare translated gps data to rectangle image (in pixels).
                  Is this a common problem with gps data and piece of map not facing the north ?

                  kshegunovK Offline
                  kshegunovK Offline
                  kshegunov
                  Moderators
                  wrote on last edited by
                  #8

                  @Marek said in QtLocation with custom map:

                  Is this a common problem with gps data and piece of map not facing the north ?

                  I'm no expert but I'd expect it is. Mercator is a cylindrical projection and as such is not "preserving" all the qualities of the original WGS84 (or equivalent) coordinates. Actually I'd expect similar problems with most if not all possible projections.

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  0
                  • M Marek

                    atually I had this problem:
                    I have a rectangle map of a small area (1km), map is not facing north, so when I get GPS coordinates of the four corners they don't make rectangle with right angles but some rhomboid figure. I thought that after applying mercator equation to GPS coordinates It will translate this to rectangle with right angles so I can have rect piece of map (x,y in pixels) and rect gps data that I can compare, but again mercator produced rhomboid figure just in different coordinates. Finally I had to write some mathematical function to translate rhomboid (gps coordinates) to rectangle and then compare translated gps data to rectangle image (in pixels).
                    Is this a common problem with gps data and piece of map not facing the north ?

                    BuckwheatB Offline
                    BuckwheatB Offline
                    Buckwheat
                    wrote on last edited by
                    #9

                    @Marek Since the earth is a sphere and longitude line not being parallel, the further away from the equator you go, the less "flat" type mappings make sense. What happens in these cases (for a decent approximation), the cos (lat) is always a factor when going from lat,lon,alt to x,y,z. So you can get crazier mappings. Most good projections are only valid for a small region before a new one will need to be used (look at US SP27 or NAD83 and UTM) to keep a rough grid. This presents a problem when crossing zones or matching up coordinates. You have to know the projections used.

                    The better solution would be to rectify your image so you know what corner represents what lat,lon and its orientation. Then you cam map it onto your coordinates.

                    For some good tools so you do not have to write projections (leave it to the masters that wrote them long ago)

                    www.gdal.org - GDAL
                    geographiclib.sourceforge.net - GeoGraphicLib
                    proj.osgeo.org - PROJ.4

                    The sites provide software to do all the transforms you could ever want... and more. ArcGIS is good too but it is pay for play if you are selling a product. The others are open source.

                    Good Fun!

                    Dave Fileccia

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved