GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Official country names  XML
Forum Index -> Discussion of GeoNames Toponyms
Author Message
Boghy



Joined: 05/06/2013 10:54:21
Messages: 1
Offline

Hi,

we are using your api to get country names, the problem is we need the official names, and, in some cases the names we get are wrong. Best examples are Czechia (it should be Czech Republic) and Macedonia (should be either Macedonia (FYR) or Former Yugoslav Republic of Macedonia (FYROM)). Is there a way to fix / modify this?

Best regards

Bogdan
colinmolter



Joined: 12/06/2013 12:34:11
Messages: 4
Offline

Not really a reply, but I want to add to that question that
more generally, it would be nice to have alternate names, similar to what we have with cities.

eg.
united states of america --> usa, etc.
belgium --> belgique, belgium, etc.

I can't find this ... any ideas?
colinmolter



Joined: 12/06/2013 12:34:11
Messages: 4
Offline

ok, I found a way, as mentioned by Marc a while ago:
in alternameNames.txt, there is the list of alternate names for everything in all language.
So, for each country, I get the geonameid, and I grep the associated lines in the alternateNames.txt file.

I focused on language of the country. so the python code end like this:

Code:
 import string, subprocess,pymongo
 
 dbuniverse = pymongo.MongoClient()['UNIVERSE']
 colcountry = dbuniverse['countries']
 altcountryfile = '/Users/colin/Downloads/alternateNames/alternateNames.txt'
 
 cursor = colcountry.find({'ISO':'BE'})
 for doc in cursor:
 	cn=doc['Country']
 	id=doc['geonameid']
 	langs=doc['Languages']
 	print cn,langs
 	for l in langs.split(','):
 		ll=l.split('-')[0]
 		togrep="%s\t%s"%(id,ll)
 		p= subprocess.Popen(['grep',togrep,altcountryfile], stdout=subprocess.PIPE)
 		out =p.stdout.readlines()
 		for r in out:
 			data = r.split('\t')
 			alt_n=data[3]
 			print alt_n
 			cursor = colcountry.update({'geonameid':id},{'$addToSet':{'altNames':alt_n}})
 
marc



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

Hi Bogdan

Originally the 'preferred name' was labelled 'official' name. This quickly turned out to be impossible to deal with as everybody has a different understanding of 'official'. There are a lot of parties on the globe who think their point of view is the only one and thus the official, other parties think the contrary and also consider themself 'official'.

I think you are referring to the UN names in your example. These name are not modelled in GeoNames. It would make the model much more complex and for those how really need the UN country names they can easily get it from other sources and process them how they like. It is a very political question and GeoNames is not a political project.

Regards

Marc

[WWW]
thills



Joined: 06/05/2021 21:23:02
Messages: 2
Offline

Hi Marc,

IMHO, I think this is a problem of definition. If you define an element as an official name, but you do not identify the official, you create the kind of problem that Bogdan is calling out.

I don't think that it makes sense to try to track each country's official names for all other countries. If that were your goal, then each official name would need a country code as well as a language code. Maybe you're up to the task? If so, great. If not, I suggest you make an arbitrary choice as to which official you will track (ISO or UN or ?), announce that decision, and then restrict all official names to solely the names provided by that official.

Otherwise, I think you would serve the world better by not labeling any names as "official", because, in fact, it only communicates confusion.
 
Forum Index -> Discussion of GeoNames Toponyms
Go to:   
Powered by JForum 2.1.5 © JForum Team