Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 6 min read How-to mediumAdept

Global weather data from flying airplanes

Weather can be inferred from ADS-B airplane telemetry stored in ClickHouse by comparing air-relative and ground-relative measurements. The gap between barometric and geometric altitude maps pressure variation, and track minus true heading gives the crab (drift) angle. Law-of-cosines formulas on ground speed, true airspeed and drift angle yield wind speed and direction. Per-pixel aggregation uses a speed-weighted vector average of wind angles, converting to x/y and back with atan2, and the results are rendered with OKLCH hue via ClickHouse color functions. The resulting wind maps match real weather data, and a bonus section shows how to script and ffmpeg-process animated map videos.

Assumes: SQL basicsbasic trigonometry

Related posts

  • The day the sky emptied: rendering the FAA outage with ClickHouse FORMAT PNG

    ClickHouse mediumAdept

    ClickHouse's built-in FORMAT PNG output renders an animated map of the November 13, 2026 FAA outage directly from SQL, with no plotting library. A query over the 380-billion-row adsb.exposed table pre-aggregates positions into per-frame, per-pixel rows using Morton-ordered Web Mercator coordinates and bit shifts. A second query paints four layers (a day-long ghost, the aircraft, a timeline and bitmap-font text) via ARRAY JOIN and the painter's algorithm, producing about 130 million pixel rows and 288 frames in 31 seconds. The data shows cruising-altitude traffic falling to under a tenth of its early-afternoon level by 20:00 ET; the post also covers float clamping, streaming animation mode to cut memory from 1.2 GB, and palette conversion shrinking the APNG from 150 MB to 25 MB.

  • Announcing adsb.exposed - Interactive Visualization and Analytics on ADS-B Flight Data with ClickHouse

    ClickHouse mediumAdept

    adsb.exposed renders tens of billions of ADS-B flight records as interactive map tiles. A parameterized ClickHouse SQL query computes the RGBA value of every pixel in each 1024x1024 tile on the fly. The single-page Leaflet frontend fetches raw RowBinary bitmaps over HTTP with ZSTD compression, which compresses better than PNG, and loads progressively from 1% and 10% sampled tables, built with materialized views, up to the full data. The MergeTree table stores Web-Mercator coordinates as UInt32 materialized columns and is ordered by a Morton curve with minmax indexes, so each tile query reads only the data it needs. The service runs on a chaos-tested ClickHouse Cloud staging environment, with requests raced against a backup service.

  • Birds in the cloud

    ClickHouse mediumAdept

    The Cornell Lab of Ornithology's eBird dataset of 1.5 billion bird observations (a 58 GB zip holding a 440 GB CSV) can be loaded into ClickHouse and visualized on the adsb.exposed interactive map. clickhouse-local queries the CSV inside the zip with schema inference. The target table drops Nullable, uses LowCardinality for low-distinct columns, and derives a date from EPHEMERAL year/month/day columns. Materialized Web Mercator UInt32 coordinates are ordered by a Morton space-filling curve with minmax indexes for fast tile queries, and the stored table compresses to 16.8 GB, about 11 bytes per row.

  • Exploring Global Internet Speeds using Apache Iceberg and ClickHouse

    ClickHouse mediumAdept

    ClickHouse's iceberg table function can query the Ookla global internet-speed dataset (128M rows) directly from S3. The schema comes from Iceberg metadata, and the walkthrough includes aggregations such as download-speed quantiles. It notes current gaps: no v2 row-level deletes or schema evolution, no partition pruning, S3-only support, and no use of sort order for file skipping. The data is then loaded into a MergeTree table, WKT tiles are parsed into Ring types, and polygon centroids are computed with shoelace-formula SQL UDFs built on arrayFold. The polygons are rendered as SVG maps using only SQL, with h3 indexes, polygon dictionaries, Mercator projection and color interpolation.

  • Visualizing Data with ClickHouse - Part 1 - Grafana

    ClickHouse mediumAdept

    Grafana connects to ClickHouse through the official ClickHouse plugin (version 2.x adds JSON and HTTP support) by creating a datasource and building dashboard panels with a query builder or raw SQL. Worked examples against the play.clickhouse.com datasets cover a monthly bar chart of Hacker News mentions, multi-series forex lines using the $__timeFilter macro and argMax, and candlesticks built with argMin/argMax/min/max. They also include a geohash-bucketed temperature heatmap on GeoMap and a log explorer view whose severity level is derived from HTTP status codes. Multi-line charts need a string series column, and SETTINGS max_result_rows lifts the playground's result limits.

The quest for software engineering knowledge.

Look:
Layout: