<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Hierarchy query with exported dump"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "Hierarchy query with exported dump"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Hierarchy query with exported dump</title>
				<description><![CDATA[ Hi everybody,

I just found out about GeoNames recently and I'm using it very successfully for some information extraction tasks. I'm using the dump files with a local DB. Now I want to access hierarchies, e.g. get the state, country, continent, … of a given city (like the "hierarchy" query offered by the web service [1]).

Currently I do not understand how to retrieve this hierarchy from the given database scheme. As far as I can see, the hierarchy.zip file does not provide this data. Can somebody give me a hint on how to achieve this?

Best regards,
qqilihq

[1] http://api.geonames.org/hierarchy?geonameId=2825297&username=demo]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4111.page#12177</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4111.page#12177</link>
				<pubDate><![CDATA[Mon, 28 Jan 2013 20:42:34]]> GMT</pubDate>
				<author><![CDATA[ qqilihq]]></author>
			</item>
			<item>
				<title>Re:Hierarchy query with exported dump</title>
				<description><![CDATA[ hierarchy.zip		: parentId, childId, type. The type 'ADM' stands for the admin hierarchy modeled by the admin1-4 codes. The other entries are entered with the user interface. The relation toponym-adm hierarchy is not included in the file, it can instead be built from the admincodes of the toponym.


Hope this helps.

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4111.page#12186</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4111.page#12186</link>
				<pubDate><![CDATA[Tue, 29 Jan 2013 06:47:34]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Hierarchy query with exported dump</title>
				<description><![CDATA[ Hi Marc,

this helps. Just to make clear, I understood correctly:

Four levels of political hierarchies are modeled directly by the four columns. Hierarchies below those levels are in the dedicated hierarchy.zip. From my findings, this hierarchy also contains relations of POIs like hotels assigned to cities.

Thank you!]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4111.page#12196</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4111.page#12196</link>
				<pubDate><![CDATA[Wed, 30 Jan 2013 20:16:46]]> GMT</pubDate>
				<author><![CDATA[ qqilihq]]></author>
			</item>
			<item>
				<title>Re:Hierarchy query with exported dump</title>
				<description><![CDATA[ The hierarchy file contains relations not covered by the admin relations, such as the hotel to city relation you mention. 

Best Regards

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4111.page#12214</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4111.page#12214</link>
				<pubDate><![CDATA[Tue, 5 Feb 2013 08:04:17]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Hierarchy query with exported dump</title>
				<description><![CDATA[ Unfortunately, I'm still having issues with understanding the hierarchy mechanisms. I currently try to replicate the functionality of the hierarchy web service with my local database dump.

If I understood correctly, there are two potential ways of retrieving a "parent":

1) Using the countryCode, admin1Code, ... admin4Code and checking in the locations data for entities with ADM1, ... ADM4 feature code and matching codes.

2) Using the data from hierarchy.txt file. Now:
a) If the hierarchy contains an entry, which one has priority? The hierarchy entry or the one I get via 1)?
b) Is there a difference in priorities, based on the type given in the hierarchy? (mostly it is "ADM" or empty/null, but there is also a minor number of other types).

Is there an explanation somewhere how to correctly perform hierarchical queries? I have searched through the forums and read the readme files several times but I cannot find any proper documentation how the hierarchy mechanism works.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4111.page#12241</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4111.page#12241</link>
				<pubDate><![CDATA[Tue, 19 Feb 2013 09:34:22]]> GMT</pubDate>
				<author><![CDATA[ qqilihq]]></author>
			</item>
			<item>
				<title>Re:Hierarchy query with exported dump</title>
				<description><![CDATA[ It depends on what you want to achieve. Normally the info in 1) is sufficient.

Best

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4111.page#12247</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4111.page#12247</link>
				<pubDate><![CDATA[Wed, 20 Feb 2013 22:03:37]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
	</channel>
</rss>