View Full Version : Any online database api to fetch city names from first few chars?
nish
11th November 2008, 06:38
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.
lyuts
11th November 2008, 09:06
If i'm understanding you correctly, then take a look at QCompleter
http://doc.trolltech.com/4.4/qcompleter.html
nish
13th November 2008, 09:06
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.?
lyuts
13th November 2008, 09:37
Google knows almost everything. How come you didn't find this?
http://www.travelgis.com/cities/
spirit
13th November 2008, 09:45
he asked about web service that he can use to get a city name using SOAP.
nish
13th November 2008, 13:43
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...
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.