<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Admin divisions relationships"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/9.page</link>
		<description><![CDATA[Latest messages posted in the topic "Admin divisions relationships"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Admin divisions relationships</title>
				<description><![CDATA[ Hi ! 

I wanted to know how I could determine the relationships that features of the database have with their administrative divisions. 

There are adm1 to adm4 codes, however I wanted to know how I could correlate these codes with actual features of the database. 

For example for "Malibu" I have the admin1 code = "CA" and admin2 code "037" with country code = "US

I would like to determine the geoname unique ID of the entry represented by 037 and the unique geoname ID of the entry represented by CA and finally the geoname entry for "US"

is this possible and how ?

Edit: I am using the database dump.

Thank you!

Cheers, 

Alex
]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1634.page#6751</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1634.page#6751</link>
				<pubDate><![CDATA[Thu, 26 Nov 2009 15:15:33]]> GMT</pubDate>
				<author><![CDATA[ azpublic]]></author>
			</item>
			<item>
				<title>Re:Admin divisions relationships</title>
				<description><![CDATA[ Alex

You just have to get the entry with the corresponding feature code. For admin1code it is ADM1 etc.

Best

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1634.page#6752</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1634.page#6752</link>
				<pubDate><![CDATA[Fri, 27 Nov 2009 06:40:46]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:Admin divisions relationships</title>
				<description><![CDATA[ Thanks Marc :) 

This helped me a lot.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1634.page#6771</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1634.page#6771</link>
				<pubDate><![CDATA[Sun, 29 Nov 2009 22:35:04]]> GMT</pubDate>
				<author><![CDATA[ azpublic]]></author>
			</item>
			<item>
				<title>Re:Admin divisions relationships</title>
				<description><![CDATA[ If I understand this correctly then, an entry for a city might have an admin1 code if there are admin1 codes in the system for the country in which the city resides.  To find the admin1 code name I take the country,admin1 combo from the city and look up the record that has that country and admin1 code as well as feature_class='A' and feature_code='ADM1'.

If that is right then so far so good and I can ask my question, which is: Should there be any records where the feature_class='A' and the feature_code='ADM1' and the admin1 fields is empty?  

I was doing a referential integrity check on a complete set of data from Dec 8, 2009 and found 79 records ADM1 records that have no admin1 value.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1634.page#6833</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1634.page#6833</link>
				<pubDate><![CDATA[Tue, 15 Dec 2009 14:31:39]]> GMT</pubDate>
				<author><![CDATA[ Claude Warren]]></author>
			</item>
			<item>
				<title>Re:Admin divisions relationships</title>
				<description><![CDATA[ One more question.  Are each of the administrative codes supposed to build upon the previous code.  Fore example a record might have value2 for country_code, admin1, admin2 and admin3, but you should not find a record that has values for country_code,admin1 and admin3 without admin2 being specified.  Is that correct?

as a follow on, each adminX field specified should have a corresponding feature_code='ADMX' record, with the same adminX value constraints specified above.  Is that correct?]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1634.page#6834</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1634.page#6834</link>
				<pubDate><![CDATA[Tue, 15 Dec 2009 14:35:26]]> GMT</pubDate>
				<author><![CDATA[ Claude Warren]]></author>
			</item>
			<item>
				<title>Re:Admin divisions relationships</title>
				<description><![CDATA[ Claude

Your understanding is correct. In reality, however, the constraints are not enforced as we do not have the resource to guarantee it at any time. The  choice is between some violations and not loosing and data or loosing data and enforce the constraint. We have opted for the first, as it is easy for a user to delete all offending records and enforce the constraints. The violating records may still be important for other users and the information helps in ultimately fixing the problems.

Best

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1634.page#6842</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1634.page#6842</link>
				<pubDate><![CDATA[Tue, 15 Dec 2009 22:37:44]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
	</channel>
</rss>