Not only the central administration entities province (changwat), district (amphoe) and subdistrict (tambon) have geocodes, but also the local administration at municipal (thesaban) level. In 2006 I had first noticed these geocodes. I was then googeling to find anything about the town subdivision chumchon, and as already mentioned I found a set of Excel sheets at the Office of Narcotics Control Board, sadly no longer accessible. These had the villages (muban) and chumchon for all provinces (except Phayao, which for unknown reason was missing). And these lists included the geocodes, including for the towns. While the districts start with 01 and then increasing, for example Amphoe Mueang Surat Thani has the 8401assigned to it; the towns start at 99 and then decreasing. So the city of Surat Thani is 8499, Na San is 8498, Tha Kham 8497 and so on.
The geocode list of the Department of Provincial Administration (DOPA) does not include them however, but in DOPA's population statistics which include the municipal areas these are sorted in exactly the same order as in those Excel sheets. It seems there is no official list online giving the whole of these geocodes. This is really needed, as the Excel sheets omitted a few municipalities and their number, I could only guess the right numbers from the order in the population statistics. Also, Phayao is completely missing, and in Nonthaburi the sheets contained 4 geocodes for the city Nonthaburi itself. It would be great if DOPA would put all geocodes into their ccaatt list, including all obsolete former ones.
The ordering of the codes to the towns seem to be mostly by age, with the provincial capital always having the 99. But as most of the municipalities were created in 1999, when the sanitary districts were all upgraded to subdistrict municipalities, the codes for these entities have a different order - these are ordered by the district where they are located, so the former sanitary districts in the Mueang district come first after the municipalities already existing in 1999. And of course the municipalities created after 1999 are given the highest still free number. In Nakhon Ratchasima, which has the highest number of municipalities, this already goes down till 3051.
The geocodes for the municipalities must have been introduced after 1993, because there are no holes in the codes for Prachinburi or Ubon Ratchathani belonging to any municipalities in the newly created provinces of that year, unlike the district geocode list.