Showing posts with label Spreadsheet. Show all posts
Showing posts with label Spreadsheet. Show all posts

Friday, March 3, 2017

Lists of the administrative units

Interestingly, I was asked several times lately to provide a full list of the administrative units - sometimes down to subdistrict level, sometimes to village level - for various purposes, for example as the basis of some academic research. In one case the location was requested as well, in another the population. My full set of data is not so easy to use, as it is in XML format and contains a lot of details, and for example the population data is in different XML files than the main list. A subset of the data is found in the spreadsheet, but most notably the Muban are missing in there. But as in all cases a simple CSV file was requested, I quickly coded something to compile such lists, and since I just got yet another request, I now also made these CSV files downloadable for everyone - even I love to know when and where my data is used, for the next time I could simply point to this blog post then...

The ZIP archive contains CSV files for each of the subdivision.
  • Province.csv - all provinces and Bangkok, with their TIS-1099 code, name in English and Thai, the latest population and number of households, and the location of the province hall.
  • District.csv - all districts (Amphoe and Khet), same data with location of the district office
  • Subdistrict.csv - all sub-districts (Tambon and Khwaeng), as before. Locations are the TAO office, but still a lot without location info
  • Village.csv - all administrative villages, however without population data. Note the comments I made earlier about the number of Muban, that list might not be 100% correct. For very few the location of the village headman office (i.e. his home) is added.
If there would be the need, I could also compile the local governments in a similar manner, however as most of those have no TIS-1099 derived code, so it is not so easy to get the hierarchy like in the central administrative units, so would have to think a bit which data would be mandatory in such a CSV then.

Friday, October 9, 2009

My Thai administrative entities spreadsheet

Since I linked my spreadsheet in the sidebar of this blog it gets a fair amount of downloads, but I might give it a bit more boost by actively promoting it, as well as answer the most common question around it.

The spreadsheet is a ODS file, the file format used by OpenOffice. Microsoft started to support it with Office 2007 Service Pack 2, for older versions one have to install a plugin. But due to the common demand I have added the Excel (XLS) version as well, but that will get updated much less regularly.

I started with this spreadsheet many years ago to collect the various data on the Thai provinces while slowly creating all the articles on Wikipedia. It has since grown a lot, from just two sheets with the provinces and the provinces sorted by population, area and population density, to now 24 sheets. I am only listing the most important ones here, so if you are looking for any of the following information on all the entities you have now found what you were looking for.
  • Districts (Amphoe, อำเภอ) - Population in census 1990 and 2000, area, date of creation, geocode in TIS1099, Census 1990 and 2000, (main) Postal code
  • Subdistricts (Tambon, ตำบล) - date of creation and upgrade (from Royal Gazette), geocode in TIS1099, subdistricts from which it was split off
  • Municipalities (Thesaban, เทศบาล) - dates of creation or upgrade for all five municipal levels (TAO, Sukhaphiban, Thesaban Tambon, Thesaban Mueang, Thesaban Nakhon), geocodes both by DOLA and TIS1099
  • TAO (องค์การบริหารส่วนตำบล) - date of creation, DOLA code, corresponding Tambon; list includes all the former TAO either abolished or upgraded to municipalities as well
The other sheets contain sometimes incomplete data, like the abolished local government units, renaming of entities, strange geocodes in the DOPA geocode list, the Sakha Tambon (still don't know what these were in fact), as well as a few source tables like the full postcodes with all exceptions. Some of these auxiliary sheets I haven't updated in the spreadsheet anymore once I started with using the XMLs of my coding project, for example the many name and spelling changes.

Monday, July 6, 2009

DOLA geocodes revisited

As I now found the DOLA geocodes in use, I have almost worked through the 7853 codes entering them into my spreadsheet. Though quite a lot of work, crosschecking my list of TAOs with this list helped me to find a few mistakes I made while creating this list from the announcements in the Royal Gazette. It were just about 5 cases, so an error ratio of less than 1 promille isn't bad I think.

Enough self-promotion, much more interesting are the details on these codes which I could find out during this work. When I first discovered them I only did a short look into the system to create the codes, and falsely claimed that for each of the levels the entities are numbered starting with the last two digits 01. This is however only partially true - the municipalities existing before 1999 are always having numbers starting with 01, and the TAO start with 01 as well. Those municipalities which upgraded from sanitary districts in 1999 however have their last two digits following the TAO codes. Also, the TAO upgraded to municipalities also kept their last two digits and only had the leading digit changed from 6 (for TAO) to 5 (for subdistrict municipality) - though a lot of them upgraded in the last years are listed as municipality but still have their code start with 6.

An interesting fact I could deduce from the numbers - these codes were adopted in 2003. I can make this quite exact dating due to the fact that between 2000 and 2004 it had several TAO merged with each other or with a neighboring municipality, but also the last of the Tambon councils getting upgraded into TAO. For those TAO abolished in 2004 it (almost) always had a code left out in the numbering, those TAO created in 2004 are added after the former sanitary districts. On the other hand, those few TAO abolished 2000-2002 have no empty space in the numbers.

To prove it with actual cases
  • Wang Kapi (วังกะพี้), Mueang Uttaradit, Uttaradit province - the TAO was merged into the municipality Wang Kapi in 2002, but the codes 6530101 till 5530117 leave final two digit free.
  • Khun Yuam (อบต.ขุนยวม), Khun Yuam district, Mae Hong Son province - the TAO was created in 2004, and has the code 6580206. The former sanitary district Khun Yuam has code 5580205.
  • Talat Chaiya (ตลาดไชยา), Chaiya district, Surat Thani district - the TAO was merged with the municipality Talat Chaiya in 2004. The codes for the district omit the number 03, so I presume that this TAO had the code 6840603.
I have also come across several cases where it has some strange codes, like omitted codes despite there are no abolished entities. I'll write up a list of these as well and post it later.

Monday, February 11, 2008

Many new municipalities?

It seems municipality creations become an recurring topic now. While looking for more information about the municipality Takut in Mueang Saraburi district, which I found to be pending announcement, one of the few hits was at kontessaban.com. There it has a complete list of all current municipalities, altogether 1277 entities. This is confirmed by the DOPAs annual statistic, where the number of municipalities is listed as 1276. In my spreadsheet I only have 1182, which means there are 95 I haven't found yet either in the Royal Gazette or the DOPA population data till 2006, so including the ones listed above it means more than 100 municipalities not yet announced. I wrote a parser for the kontessaban list, which reduced the entries to look at to 150. After eliminating those which were not automatically identified because of misspellings, I added those I cannot find in my spreadsheet yet. But it seems that list is also not without mistakes, as a few of municipalities in my list are missing there, as well as a few number in that list omitted and duplicated.

The new municipalities are not equally distributed on the country - the province Chonburi with 10 and Chiang Mai with 8 top the list. A few strange ones are between them as well - instead of extending the existing municipalities Nam Phong (Khon Kaen) or Bang Chan (Rayong), there are now new municipalities named Lam Nam Phong and Bang Chan (sic!) covering the remaining parts of the subdistrict additionally to the previous municipalities. Having two municipalities with the same name in the same subdistrict and only a different status will create quite some confusion, including create problems for my parsers.

The 2007 population statistics of DOPA only included a few of those new ones however. And as that lists is so far the only way to to guess the geocodes for them, I now have to wait one more year or a new source has to show up to get the geocodes. But of course the preliminary results as of now are incorporated in my spreadsheet already.

Tuesday, October 23, 2007

Welcome

When I started editing on Wikipedia in 2003, I noticed that many of the Thai topics were not yet covered, and then got myself into writing articles on all the provinces. It took almost a year to have all the 76 provinces with a reasonably detailed article. After that I slowly started with the districts, but that task only took pace when a Thai friend joined in and helped to translate the informations from amphoe.com, as otherwise the article would just ugly lists of data, and no real text. Now all districts have an article, but the project hasn't stopped, there is still a lot of information to be included.

This is what this blog will be about - while working on these articles, I always stumble on facts I don't understand at first, mostly due to the fact I still don't speak much Thai, especially not with the formal language with lots of technical administrative terms. So whenever I run into such a problem, or on the other hand get a good inside on things which nagged me earlier, or there's something new happening with these subdivisions of Thailand, like the recent upgrade of all the minor districts, there'll be a new posting on this blog. Or also if I finish some minor tasks in the Wikipedia articles, or add something interesting in my spreadsheet collecting all the data of the subdivisions.

Probably the first posts here will be on insights I had earlier, documenting them here for historical purposes only.