<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Alternative names for Countries ..."]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/6.page</link>
		<description><![CDATA[Latest messages posted in the topic "Alternative names for Countries ..."]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Alternative names for Countries ...</title>
				<description><![CDATA[ Hi, apologies if this is an obvious FAQ.

I've used the downloadable files to create lists of alternative names for common cities. However, I'm unsure where to start creating a list of alternatives for *country* names, eg Germany = Deutschland etc.

Which file should I be looking at?

Many thanks in advance, and thanks all of you for producing such a wonderful resource.

Tony. ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/965.page#4302</guid>
				<link>http://forum.geonames.org/gforum/posts/list/965.page#4302</link>
				<pubDate><![CDATA[Wed, 9 Jul 2008 18:57:06]]> GMT</pubDate>
				<author><![CDATA[ tjewell]]></author>
			</item>
			<item>
				<title>Re:Alternative names for Countries ...</title>
				<description><![CDATA[ Tony

For countries it is exactly the same as for cities. join the geonames table with the alternatenames table to get the names in other languages.

Best

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/965.page#4304</guid>
				<link>http://forum.geonames.org/gforum/posts/list/965.page#4304</link>
				<pubDate><![CDATA[Thu, 10 Jul 2008 08:01:44]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Alternative names for Countries ...</title>
				<description><![CDATA[ Hi Marc,
  it is still not clear to me how we go from the two letter iso-country code say IT to the different possible localization of "Italy" in the different languages.

when you say the "geonames table" you mean the cittyXXXX, right?

This geonames is truly amazing. Thanks for such a fantastic collection of data.

Giovanni]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/965.page#4424</guid>
				<link>http://forum.geonames.org/gforum/posts/list/965.page#4424</link>
				<pubDate><![CDATA[Mon, 28 Jul 2008 18:19:10]]> GMT</pubDate>
				<author><![CDATA[ gio840av]]></author>
			</item>
			<item>
				<title>Re:Alternative names for Countries ...</title>
				<description><![CDATA[ Giovanni

With "GeoNames Table" I refer to the allCountries.zip file or one of the country files. If you are only after the name of countries you can use the countryInfo.txt file which contains geoNameIds for the countries and get the names from the alternate names table.
The cityxxx files are only cities and no countries.

Best

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/965.page#4425</guid>
				<link>http://forum.geonames.org/gforum/posts/list/965.page#4425</link>
				<pubDate><![CDATA[Mon, 28 Jul 2008 20:24:24]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Alternative names for Countries ...</title>
				<description><![CDATA[ Great! Thank you for your quick reply. I am more and more impressed by geonames!]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/965.page#4426</guid>
				<link>http://forum.geonames.org/gforum/posts/list/965.page#4426</link>
				<pubDate><![CDATA[Mon, 28 Jul 2008 20:29:50]]> GMT</pubDate>
				<author><![CDATA[ gio840av]]></author>
			</item>
			<item>
				<title>Re:Alternative names for Countries ...</title>
				<description><![CDATA[ Hi

<p></p>

		<cite>marc wrote:</cite><br>
		<blockquote>
If you are only after the name of countries you can use the countryInfo.txt file which contains geoNameIds for the countries and get the names from the alternate names table.
&nbsp;
		</blockquote>

I am interested in getting the names of all the administrative divisions and the country in a specific language, so for the query "Vic, ES" I would like to return:

Vic, Provincia de Barcelona, Catalunya, España
(City name, Admin2 name in Spanish, Admin1 name in Spanish, country name in Spanish)

The way I do it is the following:

First I perform a search for "Vic" using Sphinx, where I have indexed the rows of the geoname table which have fclass = P. I order the results by proximity to the user's location, so I get first the geonameid corresponding to the "Spanish" Vic (3106050).

I get all the data corresponding to Vic by querying <span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>SELECT * FROM geoname WHERE geonameid = 3106050</pre>
		</div> to my db.

I get the admin2 name in Spanish, by first getting the geonameid of the region:
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>SELECT * FROM admin2codes WHERE code = $country.$adm1code.$adm2code</pre>
		</div>
and then looking for the name in Spanish:
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>SELECT * FROM alternateNames WHERE geonameid = $region2.geonameid AND lang = 'es' ORDER BY isPreferredName DESC</pre>
		</div>

The same happens for the country name.

<b>However</b>, i cannot do it for the admin1 codes, because the table has only the codes and the names in English, but hasn't got their geonameids.

Aren't the geonameids of admin1regions present in the table for any particular reason? Has anyone else encountered this problem? If this is the case, has somebody found an easy workaround?

I am considering to build a script that gets all the geonameids for the regions from the geoname table and adds then in a new column of the admin1codes table.

Thanks for your help,
Pau

PS: Great work, this DB is amazing!]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/965.page#7509</guid>
				<link>http://forum.geonames.org/gforum/posts/list/965.page#7509</link>
				<pubDate><![CDATA[Thu, 8 Apr 2010 12:24:14]]> GMT</pubDate>
				<author><![CDATA[ pau.moreno]]></author>
			</item>
			<item>
				<title>Re:Alternative names for Countries ...</title>
				<description><![CDATA[ you find the geonameid for the admin regions over their admincode.

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/965.page#7517</guid>
				<link>http://forum.geonames.org/gforum/posts/list/965.page#7517</link>
				<pubDate><![CDATA[Thu, 8 Apr 2010 20:04:48]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
	</channel>
</rss>