GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
How to find only countries ?  XML
Forum Index -> Administrative Divisions
Author Message
etco



Joined: 15/10/2007 18:31:01
Messages: 5
Offline

Hi,

I'm discovering your webservices and would like to search only countries (for autocomplete AJAX form). But I can't find how to proceed !!!

Why does this querry returns 0 results:
http://www.geonames.org/search?q=neth&featureCode=PCLI
BUT this returns 3 results:
http://www.geonames.org/search?q=netherlands&featureCode=PCLI
???

AND
http://www.geonames.org/search?q=bel&featureCode=PCLI
returns "Italy" ???

I would like to search "ALL COUNTRY WHERE countryName LIKE bel%" for example.

How can I do?

Thanks,
etco
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

Hi Etco

There is an undocumented parameter 'name_startsWith' for this kind of query :

http://ws.geonames.org/searchJSON?name_startsWith=neth&featureCode=PCLI

You get Italy for searches with 'Bel' because Italy is often called 'Bel Paese' and this name is among the alternate names.

Regards

Marc

[WWW]
etco



Joined: 15/10/2007 18:31:01
Messages: 5
Offline

Cool!

But it seems not work with the "countryName" parameter in french ?
It would be so great!
http://ws.geonames.org/searchJSON?countryName_startsWith=neth&featureCode=PCLI
=> doesn't work, but is it possible??
If there is not, I could test each result on the "countryName" parameter...

Thanks,
etco

marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

Hi Etco

There is no countryName parameter.
Why do you want to use a countryname parameter? Why don't you simply use the name parameter?

Cheers

Marc

[WWW]
etco



Joined: 15/10/2007 18:31:01
Messages: 5
Offline

Hi,

Why do you want to use a countryname parameter? Why don't you simply use the name parameter? 


I just want to have country names in french. So when I do this search:
http://ws.geonames.org/search?name_startsWith=bel&featureCode=PCLI&lang=fr
I have:
- Belgique => OK
- Bélarus => It should be "Biélorussie" in french
- République démocratique du Congo => do not start with "Bel"
- Pays-Bas => do not start with "Bel"
- Belize => OK (normaly in french it should be "Bélize")

So I have 2 solutions:
- directly search with the countyName parameter in french in the url... but it seems not to be possible (...search?countryNameInFrench_startsWith=bel...)
- or do the search http://ws.geonames.org/search?name_startsWith=bel&featureCode=PCLI&lang=fr , and parse the xml to find all the countries where "contryName" begins with "bel" => but it's not the best solution

I hope I am more clear about my request...
Thanks,
etco
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

Hi etco

You are very clear and I fully understand now what you want to do. I am afraid, however, that there is no easy way for this. You will have to implement the filter on your end, as you suggest in the posting.

Cheers

Marc

[WWW]
etco



Joined: 15/10/2007 18:31:01
Messages: 5
Offline

You will have to implement the filter on your end, as you suggest in the posting. 


OK,
Thanks.

---

I found some mistakes in country names in french. Where can I suggest the good names?

I found names here:
http://www.cnig.gouv.fr/upload/ressource/r1169737466.PDF
or
http://fr.wikipedia.org/wiki/Liste_des_pays_du_monde

Bye,
etco
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

Hi Etco

May I ask what kind of errors you found?

Cheers

Marc

[WWW]
etco



Joined: 15/10/2007 18:31:01
Messages: 5
Offline

Hi,

Here are the errors I noticed. But I first have a question: what is the difference between "name" and "countryName"?

All the "errors" are found comparing this PDF file (http://www.cnig.gouv.fr/upload/ressource/r1169737466.PDF) with this search on your database:
http://ws.geonames.org/search?lang=fr&featureCode=PCLI&country=...
I found many errors, but I've then compare with this url http://fr.wikipedia.org/wiki/Liste_des_pays_du_monde
and I have erased the half of the errors I found before. But it still remain following "errors".

These first errors are certainly not really errors, but I don't know the difference between name and countryName, so I mentionned them:

name: Biélorussie | countryName: Bélarus | countryCode: BY | => we commonly use "Biélorussie"

name: Moldavie | countryName: Moldova | countryCode: MD | => we commonly say "Moldavie"

name: Salvador | countryName: El Salvador | countryCode: SV | => we commonly say "El Salvador"

name: Centrafrique | countryName: République Centrafricaine | countryCode: CF | => we commonly use République Centrafricaine

name: Iles Fidji | countryName: Fidji | countryCode: FJ | => we never use Iles Fidji

name: Grande Bretagne | countryName: Royaume-Uni | countryCode: GB | => we commonly say Royaume-Uni

name: Vatican | countryName: Saint-Siège (Etat de la Cité du Vatican) | countryCode: VA | => we commonly say Vatican


For the three countries below, the name that is commonly used in french is not mentionned in your database:

Myanmar | countryCode: MM | => we commonly say "Birmanie" and I don't find "Birmanie" in your database

Timor-Leste | countryCode: TL | => we commonly say "Timor oriental" and I don't find "Timor oriental" in your database

Kirghizistan | countryCode: KG | => we commonly say "Kirghizstan" and I don't find "Kirghizstan" in your database



Here, I think these are real errors:

name: Serbie | countryName: Serbia | countryCode: RS | => we never say "Serbia"

name: Benin | countryName: Bénin | countryCode: BJ | => Bénin is correct AND NOT Benin

name: Vénézuéla | countryName: Vénézuela | countryCode: VE | => Vénézuéla OR Venezuela BUT NOT Vénézuela

name: Monténégro | countryName: Montenegro | countryCode: ME | => Monténégro is correct AND NOT Montenegro

name: Turkménistan | countryName: Turkmenistan | countryCode: TM | => Turkménistan is correct AND NOT Turkmenistan


And last, I found two countries that are not in your database:

Marshall (les Marshall) | countryCode: MH

Micronésie (la Micronésie) | countryCode: FM

Regard,
etco
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

Thanks Etco. I have recreated the country name files and the onces I have checked are all correct now. I don't know why these names have been corrupted.

Cheers

Marc

[WWW]
 
Forum Index -> Administrative Divisions
Go to:   
Powered by JForum 2.1.5 © JForum Team