Results 1 to 6 of 6

Thread: Any online database api to fetch city names from first few chars?

  1. #1
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Any online database api to fetch city names from first few chars?

    Hi..

    I have a line edit in which user can type a city name(even first few chars of the name). I need to give him the list of all possible city names.. for eg.

    user types...
    "New"

    so i should give a list of cities like
    "New Delhi"
    "New York"
    ...
    ..
    etc

    for this i cant supply the database with the app.
    do anyone knows some online database service which can return the names?

    some thing like.. i call
    QHttp::get("http://www.someserver.com/getSimilarCities?like=New");

    please help..

    thx.

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Any online database api to fetch city names from first few chars?

    If i'm understanding you correctly, then take a look at QCompleter
    http://doc.trolltech.com/4.4/qcompleter.html
    I'm a rebel in the S.D.G.

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Any online database api to fetch city names from first few chars?

    you got me wrong...

    displaying of data is not a problem... i can use qcompleter, or even just list the contents anywhere...

    the problem is where to get the data?..

    imagine it like this...

    i send a query to my email server to give me the headers of new emails... and the server provides me the list.

    similary i want to know weather there exists some free service (server) on the internet which can send me the suggested list of cities for my query.?

  4. #4
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Any online database api to fetch city names from first few chars?

    Google knows almost everything. How come you didn't find this?
    http://www.travelgis.com/cities/
    I'm a rebel in the S.D.G.

  5. #5
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Any online database api to fetch city names from first few chars?

    he asked about web service that he can use to get a city name using SOAP.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  6. #6
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Any online database api to fetch city names from first few chars?

    Quote Originally Posted by spirit View Post
    he asked about web service that he can use to get a city name using SOAP.
    ya.. exactly..

    I am designing a weather widget...
    now to get the weather for a particular city i post a query to google as

    QHttp::get("http://www.google.co.in/ig/api?weather=London");

    open your browser and type this url
    http://www.google.co.in/ig/api?weather=London

    you will get a xml document...

    so that is fine...

    now my user will type a city name which he may misspell...
    on many weather sites if you misspell the city name.. they provide the list of suggestions...

    i want to know the some free RSS feeds or xml(like google above) or anything servers, which can return the suggestion list...


    hope i am clear this time...

    but thx for the help you guys...

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13

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.