GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
ISO-3166-2 Administrative Division Code  XML
Forum Index -> Administrative Divisions
Author Message
chetta



Joined: 10/12/2008 19:19:58
Messages: 1
Offline

Where can I get (dump file or web service) the ISO-3166-2 Administrative division code for province/state?

As displayed here http://www.geonames.org/CA/administrative-division-canada.html (QC,BC,ON, etc) ISO-3166-2 column

Thank you.
marc



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

Hi

The ISO codes are not yet in the dump. We are working on it.

Best

Marc

[WWW]
aaronchi



Joined: 14/10/2009 20:07:21
Messages: 2
Offline

Any chance that this might happen some day soon???
marc



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

not in the next weeks. We simply don't have enough resources. Do you want to help?

Marc

[WWW]
aaronchi



Joined: 14/10/2009 20:07:21
Messages: 2
Offline

I will help if I can. I'm not sure what the issue is. I just want to have another column in the dump that specifies the ISO-3166-2 code if it exists. Maybe it can be put into the admin1CodesASCII.txt or even a new dump file?

What can I do to help?
bundini



Joined: 03/11/2009 05:01:00
Messages: 2
Offline

It should be possible to make it 90% there by cross referencing the information in:

http://www.commondatahub.com/live/geography/state_province_region/fips_states_codes

They have a primary key there.
They also maintain an iso code table (with the same pk).

Files are downloadable separately. I'm going to import a dump of their data and hack the two together into one table that has both fips and iso codes and report back.

bundini



Joined: 03/11/2009 05:01:00
Messages: 2
Offline

So here's the results of what I've done.

If you know some better data sources let me know. I've included a rapidly strewn together script that I used to generate this data. The CDH data referenced can be found online (not sure what the legality of me including it in the file would be).

The attached file contains "results.txt" which has the cross references between country, and administrative region 1 fips code, and administrative region 1 iso code. It's tab delimited so it should be easy to blow apart with your favorite scripting language to generate the sql required. I'd probably just create a nested associative array(PHP)/dictionary(Python) and use them to look up the iso code from the 2 letter country codes / fips codes we already have.
 Description [Disk] Download
 Filesize 28 Kbytes
 Downloaded:  20743 time(s)

chaosmonkey



Joined: 22/04/2016 02:22:06
Messages: 5
Offline

Hi,
Is there any update on this. When does geonames plan to include the ISO 3166-2 codes in their data?

Thanks.
Tigrov



Joined: 14/03/2017 18:57:49
Messages: 18
Offline

You can find a parser for the divisions at https://github.com/Tigrov/geoname-divisions

And the results:
https://raw.githubusercontent.com/Tigrov/geoname-divisions/master/result/divisions.csv
https://raw.githubusercontent.com/Tigrov/geoname-divisions/master/result/subdivisions.csv
Tigrov



Joined: 14/03/2017 18:57:49
Messages: 18
Offline

Also you can find a parser for divisions from Wikipedia at https://github.com/Tigrov/wikipedia-divisions

And the results:
https://github.com/Tigrov/wikipedia-divisions/blob/master/result/divisions.csv
https://github.com/Tigrov/wikipedia-divisions/blob/master/result/subdivisions.csv

and names translated in different languages
https://github.com/Tigrov/wikipedia-divisions/blob/master/result/names.csv

The results have actual Wikipedia URLs, while Geoname has some wrong and outdated Wikipedia URLs.

There are some difference between Geoname and Wikipedia ISO codes:
Country ISO codes in Geoname which are not exist in Wikipedia: AS, BM, CC, CK, HK, HM, IO, MP, NC, PF, PM, SJ, TC, TK, VI

Some difference for country ISO codes AZ, MG, MV, TW

And difference for division ISO-codes:
BS-NP
BW-CH,FR,GA,JW,LO,SP,ST
DO-33,34,35,36,37,38,39,40,41,42
DO-01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26
,27,28,29,30,31,32
GR-69
MK-01,09,15,17,28,29,31,38,39,57,68,77,79,84
PH-18
 
Forum Index -> Administrative Divisions
Go to:   
Powered by JForum 2.1.5 © JForum Team