ThaiGovData

Methodology

What we do to the data before showing it, and — more usefully — what we decline to do.

Thai search

Thai is written without spaces between words, which is why the upstream portals' own search does not work: querying data.go.th for “สถานีตำรวจ” (police station) returns over twenty thousand results, almost none of them relevant. We segment with Node's Intl.Segmenter and build a weighted full-text index — titles count for more than descriptions — with trigram similarity as a fallback when segmentation misses. The segmenter keeps some compounds whole, e.g. ตำรวจนครบาล (metropolitan police), which is a known limit rather than a solved problem.

Buddhist and Common Era dates

Thai data mixes BE and CE, sometimes within one column. Everything is stored as CE and re-derived as BE for the Thai locale at display time; a year above twenty-four hundred is treated as BE and five hundred and forty-three is subtracted. Records whose upstream dates are corrupt, produced by bad conversion at source, are counted and skipped rather than guessed at and repaired.

Duplicates

data.go.th harvests GD Catalog, so a large share of datasets appear in both. We match on the CKAN harvest identifier first, then on normalised resource URLs. Title-only matches go to a review queue and are never merged automatically, because annual editions of the same dataset share a title year after year. Headline counts exclude anything marked as a duplicate.

Matching things to provinces

Coordinates are assigned to a province by testing whether the point falls inside the province boundary, not by finding the nearest provincial centroid. Nearest-centroid is wrong along borders — a point in southern Chiang Mai is closer to Lamphun's centroid than to Chiang Mai's — and the failure is silent: the per-province counts look entirely reasonable while being wrong.

What we deliberately do not store

Personal insolvency notices in the Royal Gazette are counted but not stored. We can report how many there were without building a searchable index of the names and addresses of people who went bankrupt twenty years ago. Over four hundred thousand documents are excluded on this basis. Royal Thai Police crime statistics are kept at province level only. District and subdistrict are discarded, because small case counts in a small tambon identify people.

Procurement data

ACT Ai's source files glue multiple winners into a single row with no separator — names, registration numbers and prices all run together, which turns a price into a meaningless enormous number. So only rows whose registration number is exactly thirteen digits and whose value is at or under twenty billion baht enter the totals. The rest are kept and counted but excluded. We do not attempt to split the concatenated values back apart, because there is no way to do it that is reliably correct.

OpenStreetMap data

OpenStreetMap is published under ODbL, whose share-alike terms can propagate to a database it is combined with. It is therefore held in separate tables and joined to everything else only at display time, with the result never written back.

What is missing

The Comptroller General's e-GP feed on data.go.th has stopped updating, and PDMO — which was the best-formatted public debt publisher on the platform — is unreachable. Both remain in the source list, marked as failing. Actual disbursement used to be the largest gap on this site. It is now filled: the money page shows both appropriation and what GFMIS records as actually paid, back to fiscal year 2016. What is still missing is contract-level procurement after 2023. We hold e-GP's own yearly totals through the current fiscal year, but the row-level detail stops where the ACT Ai mirror stops.

See also: sources · system status · licensing