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 get the local name of a country?  XML
Forum Index -> FAQ - frequently asked questions
Author Message
Sergillop



Joined: 14/04/2011 19:38:37
Messages: 3
Offline

For instance, how to get "España", when you have name "Spain" and country code "ES"?
marc



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

http://api.geonames.org/search?q=spain&maxRows=10&lang=es&username=demo&featureCode=PCLI&country=es

The translated name is in the element 'name'

Marc

[WWW]
Sergillop



Joined: 14/04/2011 19:38:37
Messages: 3
Offline

Thanks for your reply Marc.

I'm a bit confused.. this is what I have in the mysql table geonames, for the geonameid in your link:

geonameid 2510769
name Kingdom of Spain
asciiname Kingdom of Spain
alternatenames An Spainn,An Spàinn,An Spáinn,Caxtillan,Caxtillān,...
latitude 40.0000000
longitude -4.0000000
fclass A
fcode PCLI
country ES
cc2
admin1 00
admin2
admin3
admin4
population 46505963
elevation 0
gtopo30 532
timezone Europe/Madrid
moddate 2010-09-16


And in countryInfo for ES:

iso_alpha2 ES
iso_alpha3 ESP
iso_numeric 724
fips_code SP
name Spain
capital Madrid
areainsqkm 504782
population 46505963
continent EU
tld NULL
currency EUR
currencyName NULL
Phone NULL
postalCodeFormat NULL
postalCodeRegex NULL
geonameId 0
languages .es
neighbours NULL
equivalentFipsCode NULL

It differs from the information in your link, did I import the wrong files?
marc



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

The translations to other languages are in the file 'alternatenames.zip'.

Marc

[WWW]
Sergillop



Joined: 14/04/2011 19:38:37
Messages: 3
Offline

marc wrote:
The translations to other languages are in the file 'alternatenames.zip'.

Marc 


Ok... I guess the problem is that I imported the alternatename1000.txt, and alternate names for countries are probably not there...

Sorry about the newbie questions and thanks again :>
 
Forum Index -> FAQ - frequently asked questions
Go to:   
Powered by JForum 2.1.5 © JForum Team