GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
The same geoname ID in several tables  XML
Forum Index -> Discussion of GeoNames Toponyms
Author Message
bitherder



Joined: 01/10/2008 16:38:54
Messages: 4
Offline

I've been creating a import script for the geonames dump files, which works fine except for one issue – I'm having trouble because entries in different tables have the same geonames ID.

I have a geonames ID table that, for each ID, references back to the entity that the ID belongs to in order to do a search on a specific ID w/o knowing ahead of time what kind of thing it refers to. When I import each item, I create an ID entry in this table and the ID column is constrained to be unique. As I import data, I find that there are IDs that show up in multiple tables and this causes the SQL insert to crap-out due to the uniqueness constraint.

A couple of examples:

Continent of Antarctica and country of Antarctica: 6255152
Country of Aland Islands, admin 1 region Åland (FI.01) and the location of Ahvenanmaan Lääni: 661882

Is there a mistake in the data, or am I modeling this wrong? Do I need to allow for the same entity to show up in multiple roles/positions in the hierarchy?

If a region can have multiple roles with the same ID, and there are alternate names for that ID, should the alternate names apply to all the roles of the region?
marc



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

A concept should only have one geonameId. Antarctica is discussed in this thread http://forum.geonames.org/gforum/posts/list/1083.page

I don't know what "Ahvenanmaan Lääni" is or means. If it is something different than please help us fix the error.

Best

Marc

[WWW]
bitherder



Joined: 01/10/2008 16:38:54
Messages: 4
Offline

OK, so a "concept" should only have one geonameId, but can the same "concept" be both a country and an admin 1 region, for example?

The thing I'm trying to figure out, is whether there is a 1:1 relation between a geonameId and entries in the various table entries or if it's possible to have the same concept/entity end up in two (or more) entries across the country/admin region/location tables with the same geonameId. If it can, I need to remove my uniqueness constraint on my single geonameId table.

In the end I think I'll need to allow for the flexibility of multiple entries having the same geonameId, since this situation already occurs in the current data and I'm guessing there isn't any constraint in the source database/application to prevent this from happening in the future. Given that, I guess now I'm just trying to understand the semantics of something showing up as both a country and an admin region of a different country.

Reading the Wikipedia page for Aland Islands (because I had never heard if it before), it looks like an interesting case – it's a semi-autonomous state loosely under Finland. So from what I read, in some ways it's its own country, but in others it's a dependent state under Finland. So I guess it might make sense for it to be in the country table and in the regions table. Would it also make sense for it to show up in the locations list? Don't know.
McBack



Joined: 17/10/2008 06:37:40
Messages: 6
Offline

Reading the Wikipedia page for Aland Islands (because I had never heard if it before), it looks like an interesting case – it's a semi-autonomous state loosely under Finland. So from what I read, in some ways it's its own country, but in others it's a dependent state under Finland. So I guess it might make sense for it to be in the country table and in the regions table. Would it also make sense for it to show up in the locations list? Don't know. 


Long time since anyone write something here, but Åland is a part of Finland on ADM2 level. So it s not a country.
 
Forum Index -> Discussion of GeoNames Toponyms
Go to:   
Powered by JForum 2.1.5 © JForum Team