GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Vague Admin Codes  XML
Forum Index -> Administrative Divisions
Author Message
AlanS



Joined: 02/05/2007 12:36:32
Messages: 2
Offline

Can anyone explain why some admin codes have useful names whereas other just contain things like (TO01), (TO02) etc.

Togo is a prime example, there's a Togo (general), and then 26 other codes, some with actual names and others without.
marc



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

The admin1 codes are the "Federal Information Processing Standards Codes" (FIPS). The codes without proper names in parenthesis have been superseded by new codes. For Togo this changed in March 2006 :

http://earth-info.nga.mil/gns/html/fips/FIPS10-4CN-10-d.pdf


Marc

[WWW]
AlanS



Joined: 02/05/2007 12:36:32
Messages: 2
Offline

If they've been superceded, shouldn't all the cities etc which used to point to the old admin code now point to the new admin code which replaces it?

for example, Zwarte Poort has an admin code of (BE02)

shouldn't Zwarte Poort point to the admin code which replaced (BE02) ??
 Description Here's a selection of a few more cities which point to superceded admin codes. [Disk] Download
 Filesize 3 Kbytes
 Downloaded:  1860 time(s)

marc



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

Hi Alan

You are absolutely right. They should get the new admin code. What we can do is use boundary shape to determine the new code, but this will only work for countries where we have the new admin1 boundaries.

Cheers

Marc

[WWW]
Julian



Joined: 26/04/2007 18:25:11
Messages: 40
Location: UK
Offline

Hi Marc, Alan,

For the superceded ones, can't we just do an update? I tried this for the last two fips bulletins and it seems to work (in mysql4):
Code:
 CREATE TABLE adminmap (cc char(2) default NULL, old int(11) default NULL, new int(11) default NULL);
 
 INSERT INTO `adminmap` VALUES ('AF',20,39),('AF',21,40),('BG',80,84),('BC',7,11),('CF',3,13),
 ('DJ',1,1),('DJ',2,6),('DJ',3,7),('DR',5,34),('DR',17,35),
 ('GA',3,3),('ID',9,36),('ID',19,37),('ID',20,38),('IR',31,40),
 ('LI',2,19),('LI',5,20),('MY',14,14),('MD',13,57),('MD',49,58),
 ('MO',7,45),('MO',13,46),('MO',19,47),('MO',20,48),('MO',24,49),
 ('NZ',10,10),('NI',11,11),('SG',8,13),('SG',4,14),('SE',3,3),('SE',13,24),
 ('SE',15,25),('SE',16,26),('SE',21,27),('BP',5,10),('BP',4,11),('TZ',1,26),
 ('SO',11,18),('SO',15,19),('SO',16,20);
 
 update geonames set admin1_code = (select new from adminmap
 where country_code=cc and admin1_code=old) 
 where country_code in (select cc from adminmap) and admin1_code in (select old from adminmap);
 

For the complex changes like Togo, we need boundaries


Julian
[code]
Julian



Joined: 26/04/2007 18:25:11
Messages: 40
Location: UK
Offline

Hi,

these just need adding to admin1codes.txt

SO18 Nugaal
SO19 Togdheer
SO20 Woqooyi Galbeed

Julian
marc



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

Thanks Julian. I have updated the simple fips changes with your table.

Cheers


Marc

[WWW]
Julian



Joined: 26/04/2007 18:25:11
Messages: 40
Location: UK
Offline

Great

One of the other changes we needed to make life easy was in the main geonames table, everywhere where there is an admin1code < 10, make sure the leading zero is present.

Julian
marc



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

Hi Julian

Indeed there was a problem with a handful of records in Grisons, Switzerland. I have corrected them. ('9' > 'GR').

Note that Switzerland (and the US) was already switched to ISO instead of FIPS. The aim is to move as many countries as possible to ISO as it is more known in the rest of the world. It is a lot of work and will take some time.

Cheers

Marc

[WWW]
 
Forum Index -> Administrative Divisions
Go to:   
Powered by JForum 2.1.5 © JForum Team