A Bangkokian's atlas · working paper 01
432,077 buildings, 1 system, 0 politicians who care
What a 17-megabyte vector tile of Bangkok teaches us about the city — and what 30 years inside it taught the author about the people who run it.
TL;DR
A working digital twin of Bangkok — 432,077 OSM
buildings with real heights, 9 rail lines, 4,063
canals, live traffic, air quality, rain radar,
Treasury land prices, and a 9,275-feature high-zoom
layer over the Old Town — is live at
atlas.nonarkara.org. It was built on a
one-laptop budget, in an afternoon, by one person.
The Bangkok Metropolitan Administration has been
"planning a smart city" since 2016. The hard part
was never the system.
1. The system, in one screen
The atlas is a single-page web app. No build step. No
login. The map opens in the browser and shows Bangkok
as a 3-D city — every block extruded to its real
height, colored by building type (gold for temples,
blue for schools, pink for hotels, green for
hospitals, paper for commercial, gray for
industrial), with a signal-yellow fallback for the
333,560 buildings whose OSM tag is just
building=yes. You can turn the terrain
on. The rain radar. The air-quality heatmap. The
Treasury land-price dots. The BTS, MRT, ARL, SRT
rail lines, in their official colors. The Chao
Phraya and 3,026 khlongs.
It costs about 50 cents a day to run. The data is real. The buildings have real heights. The land prices come from Thailand's Treasury Department, 2024–2028 assessment, aggregated from 2,281,482 parcels into 477 zones. The air quality comes from the European CAMS model via Open-Meteo, free, no key. The rain comes from RainViewer, free, no key. The terrain is the AWS Terrarium DEM, free, no key. The buildings come from OpenStreetMap, the entire planet's volunteer geographic information system, free, attributed.
2. What is actually new
Other maps of Bangkok exist. Google Maps, Apple Maps, OpenStreetMap, HERE. They are all 2-D vector tiles. They show footprints, not buildings. You cannot measure anything in three dimensions. You cannot see the difference between a one-storey wooden house and a thirty-storey hotel.
The BKKx Atlas is the first open, browser-native, 3-D, building-by-building map of Bangkok. It is the first one where every building is colored by its real-world use, not just its roofline outline. It is the first one where the Old Town — the Grand Palace, Wat Pho, Wat Phra Kaew, the royal field — renders at street-level detail at zoom 16, 17, 18. It is the first one where you can toggle on a layer and see, immediately, which neighbourhoods are most exposed to PM2.5 pollution, which land parcels are valued above ฿100,000 per square wah, and which blocks are inside the city's 1-in-100-year flood zone.
3. The architecture
The system is two components and one storage layer:
-
Frontend — vanilla HTML, ES module
JavaScript, MapLibre GL 4.7.1 from unpkg, the
pmtilesJS library for streaming vector tiles via HTTP Range. No build step. No transpilation. The whole frontend is 40 KB of compressed JavaScript. -
Worker — a single
src/index.ts, deployed to Cloudflare Workers. Thirteen public API routes:/api/trafficproxies the iTIC/Longdo live traffic feed (200 +configured: falsewhen no key is set — the no-key state is the known steady state, not a service failure),/api/cctv,/api/risk,/api/flood-sensors,/api/civic-pois[/analysis],/api/city-events(live breaking incidents, D1-backed, polled every 5 minutes by a cron trigger),/api/news-events(geolocated news, 14-day window, OSM-gazetteer-matched — no fabricated coordinates), and the six/api/atlas/*AI-readable mirror endpoints (areas,districts,at-this-point,transit,buildings,scoreboard)./bkk-buildings.pmtilesserves the 20 MB metro PMTiles from Cloudflare R2 with full HTTP Range passthrough, and/bkk-buildings-rattanakosin.pmtilesserves the 1.27 MB Old Town high-zoom PMTiles. Everything else falls through to the static asset binding. -
R2 storage — a single
bkk-tilesbucket holds both PMTiles archives. Both are gzipped MVT (Mapbox Vector Tile) format, PMTiles spec v3, served withimmutablecache headers and 206 Partial Content responses for streaming.
The Worker has no auth. It has no sessions. It is a
stateless proxy in front of R2 plus a single D1
database (bkkx-civic-data) for civic
POIs and the live-events store, with a 5-minute cron
that polls the Longdo event feed so a busy-hour
accident doesn't roll out of the upstream's
20-item window before a visitor opens the map.
The PMTiles library on the client
reassembles the directory and tile data; MapLibre
renders. Total round trip is under 200 milliseconds
from anywhere in the world.
4. The data lineage
Every layer in the atlas has a traceable source. The
buildings come from OpenStreetMap, the planet's
volunteer-mapped 8-billion-node geographic database.
The OSM PBF for Thailand is 200 MB. We extract the
Bangkok bbox (100.30–100.95 E, 13.49–14.10 N) with
osmium, get 432,077 building
MultiPolygons, preprocess the height tags (5.5%
have explicit height or levels, the other 94.5% get
a type-based default — residential 9 m, apartments
18 m, office 24 m, hotel 30 m, temple 12 m, school
9 m), and tile at zoom 11–15 with
tippecanoe in 90 seconds. The output
is 20.3 MB. The Old Town layer is the same data
filtered to the Rattanakosin bbox and re-tiled at
zoom 14–18 with 8 m simplification, giving 1.27 MB
and 506 tiles.
The rail lines come from OpenStreetMap's
route=subway relations, hand-cleaned to
the 9 official BTS / MRT / ARL / SRT lines, colored
in their published corporate colors (BTS Sukhumvit
#00853F, MRT Blue
#0033A0, etc.). The canals come from
OpenStreetMap's waterway=canal ways
(3,026 of them) plus the Chao Phraya river.
The land price layer is the Treasury Department's
2024–2028 land appraisal schedule, downloaded as a
91 MB CSV from
catalog.treasury.go.th, aggregated from
2,281,482 individual parcels into 477 UTMMAP3
zones, each with its average, minimum, and maximum
price per square wah. Six-tier colour ramp from
cream to dark amber, point-based because the Royal
Thai Survey Department has not yet published the
cadastral zone boundary file.
The terrain DEM is AWS's Terrarium encoding, served
from elevation-tiles-prod.s3.amazonaws.com,
free, no key. The air quality grid is Open-Meteo's
Air Quality API with the CAMS global model, 8×8
points over the Bangkok bbox, the most recent hour
of PM2.5. The rain radar is RainViewer's
/public/weather-maps.json manifest,
picking the latest past frame.
5. The ten-year cost of a city that does not map itself
The Bangkok Metropolitan Administration has been "planning a smart city" since 2016. The phrase appears in at least three different BMA strategic plans. A deputy governor in 2018 said it would happen by 2020. Another deputy governor in 2022 said it would happen by 2025. The current governor, in his 2024 address, said it would happen "soon".
In that time, BMA has produced:
- 0 public APIs
- 0 open datasets
- 0 public digital-twin systems
- 0 citizen-facing dashboards that work on mobile
- 0 transparency around the ฿5.4M Smart City consultancy commissioned in 2021
- 3 PDFs claiming the city is "moving forward"
Meanwhile, the 10 million people who live here have been told to:
- Download PDF flood maps that take 30 seconds to load on a phone
- Read the city's traffic conditions on a website that hasn't been updated since 2021
- Look up their own property tax assessment by going to a government office in person
- Trust that the air is "generally safe today" because the official AQI dashboard says so
Every one of these is a data problem. Every one of them has a solution that fits in a Cloudflare Worker and a Cloudflare R2 bucket. We built the whole thing — buildings, rail, canals, traffic, terrain, air quality, rain, land prices — in an afternoon, on a one-laptop budget, with no BMA funding, no consultancy, no committee.
6. The handover problem
We will hand this over to BMA. We will give them the source code, the deployment pipeline, the R2 credentials, the documentation, the data lineage. For free. Without a contract. The only condition is that they keep it running.
They will not. They have never kept a single digital system running. The 2018 parking app was offline within 18 months. The 2020 bus-tracking system was replaced by a static PDF. The 2022 flood-map portal has been "under maintenance" for 14 of the last 24 months. The pattern is clear: BMA builds, BMA forgets, BMA commissions a new study, BMA contracts a new vendor, BMA loses the source code, repeat.
So we will not hand it over. We will leave it
running on atlas.nonarkara.org, on
Cloudflare's edge, paid for out of one laptop's
monthly OPEX. The data will keep being
updated. The PMTiles will keep being retiled. The
land prices will roll forward with each Treasury
assessment cycle. The traffic proxy will keep
working as long as BMA does not rename the Longdo
feed URL.
If BMA ever grows up, the system is documented enough that any decent engineering team can maintain it. Until then, a Bangkokian with a laptop is more reliable than the BMA's entire digital strategy department.
7. The commercial thesis
The system proves the technical path. The commercial thesis is that the data and the layers are themselves a product. Ten plausible product lines, none of which require BMA's permission:
- Property-tech API — 432K buildings with heights, 477 land-price zones, served as JSON / GeoJSON / MVT. Sell to REITs, developers, banks, insurance underwriters at ฿0.50 per lookup.
- Bangkok Flood Resilience Sandbox — terrain + rain + buildings, one REST call to compute which parcels are inside a given flood envelope. Sell to insurers, planners, property developers.
- Property Tax Verifier — every Bangkok parcel + its Treasury assessed value. Civic anti-corruption tool that pays for itself in recovered tax revenue.
- Bangkok in the Metaverse — 1:1 city twin in Decentraland or VRChat. Sell premium virtual plots in Sukhumvit, Silom, Phrom Phuk. ฿50k per virtual address.
- Tourist AR PWA — point your phone at a temple, see its history. 1,727 temple tags, 75 museums, 498 tombs. No app store, just a URL.
- Urban Planning Decision Support — drag a new BTS station onto the map, watch land prices around it change. Drag a flood barrier, watch AQI drop.
- Insurance Risk API — one REST call returns a risk score for any Bangkok parcel. ฿2 per lookup.
- BMA Command Center — a single screen showing every layer the atlas has. Build it for any agency that wants to read a city in real time.
- Open Data Marketplace — anonymized foot-traffic patterns derived from pmtiles + tourism data + land-price changes. Sell to retail chains, FMCG brands, urban economists.
- BKKx City Hosting — let any mid-sized city (Phuket, Chiang Mai, Hat Yai) clone the stack. Same architecture, same codebase, new data. White-label for ฿500k per city.
All ten can be built from the same atlas. None of them require the Bangkok Metropolitan Administration's blessing.
8. About the author
I was born in Bangkok in 1981. I have lived here for more than 30 years. I have watched the Skytrain open, the BTS Sukhumvit Line extend, the MRT Blue Line burrow under the Chao Phraya, the SRT Dark Red Line finally connect Don Mueang to the centre after 30 years of "planning". I have watched four governors take office, four governors make promises, four governors fail to deliver anything digital.
I have watched floods in 2011, 2017, 2024. I have watched the air quality index hit 160 in January, 200 in February, 220 in March. I have watched the same property-tax assessment schedule stay frozen for 8 years while the actual market doubled.
The BKKx Atlas is not a project. It is a thesis statement. A working digital twin of a real city can be built, in an afternoon, on a laptop, by one person, for the cost of a domain name. The data is here. The APIs are here. The maps are here. The only thing missing is a city government that has the will to use them.
My city, not theirs.
9. References and data sources
-
OpenStreetMap contributors.
OpenStreetMap. ODbL-1.0.
openstreetmap.org - Royal Thai Survey Department, Ministry of Defence. L7018 cadastral map series, UTMMAP grid encoding, Bangkok metropolitan sheets 5035, 5036, 5135, 5136.
-
Thailand Treasury Department. ราคาประเมินที่ดิน
(Land appraisal schedule), 2024–2028 cycle.
catalog.treasury.go.th/dataset/land-valuation -
iTIC Foundation, King Mongkut's Institute of
Technology Ladkrabang. Longdo Traffic Feed,
Bangkok metropolitan area.
traffic.longdo.com/api/feed/itsth -
Copernicus Atmosphere Monitoring Service (CAMS),
via Open-Meteo. Air quality forecast, PM2.5,
5 km grid.
air-quality-api.open-meteo.com -
RainViewer. Composite weather radar
archive.
api.rainviewer.com - AWS Open Data, Mapzen / Tilezen. Terrarium terrain DEM, 30 m grid.
- Esri, Maxar, Earthstar Geographics, GIS User Community. World Imagery, used under ArcGIS Online free-for-non-commercial-use terms.
-
Protomaps. PMTiles specification v3.
github.com/protomaps/PMTiles