Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Geocoding and reverse geocoding in Qt Mobility

    Mobile and Embedded
    3
    3
    2284
    Loading More Posts
    • 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.
    • Q
      QtQueries last edited by

      Hi

      I'm using the latest Qt Mobility in my app. QGeoServiceProvider::availableServiceProviders() returns one result - "nokia". This search provider returns true for both supportsGeocoding() and supportsReverseGeocoding(), however all geocoding and reversegeocoding requests return no results.

      Are these features currently supported? Is there any other way to access them on Qt?

      Thanks

      1 Reply Last reply Reply Quote 0
      • F
        frankcyblogic.de last edited by

        I recently tried this on Maemo (qtm1.2 beta), where it wasn't working and then two weeks later on Symbian^3 with qtm1.1 it worked fine. I'm still unsure, if it's just a fluctuation in service availability, or if it's something else. So if you are lucky getting it spit out something, it would be nice to hear, which configuration worked when and how.

        1 Reply Last reply Reply Quote 0
        • M
          mariusbu last edited by

          I have the same problem. Does anybody have an update on this issue ? Is the service just flaky, am I doing something stupid or is QGeoSearchManager borked ?

          *Update: problem solved - I was creating the service provider object on the stack. Without the service provider object, nothing works, obviously. Updated the code to show the working version.

          Here is the code I'm using:

          @
          QGeoServiceProvider *geoServiceProvider = new QGeoServiceProvider("nokia");
          if (geoServiceProvider->error() == QGeoServiceProvider::NoError) {
          QGeoSearchManager *geoSearchManager = geoServiceProvider->searchManager();
          if (geoSearchManager && geoSearchManager->supportsReverseGeocoding()) {
          m_geoSearchReply = geoSearchManager->reverseGeocode(m_geoCoordinate);
          if (m_geoSearchReply) {
          if (m_geoSearchReply->isFinished()) {
          if (m_geoSearchReply->error() == QGeoSearchReply::NoError) {
          finished();
          } else {
          error(m_geoSearchReply->error(), m_geoSearchReply->errorString());
          }
          } else {
          connect(m_geoSearchReply, SIGNAL(finished()), this, SLOT(finished()));
          connect(m_geoSearchReply, SIGNAL(error(QGeoSearchReply::Error, const QString&)), this, SLOT(error(QGeoSearchReply::Error, const QString&)));
          }
          }
          } else {
          qDebug() << "failed to find search manager";
          }
          }
          }@

          Cheers,
          Marius Bugge Monsen (mbm)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post