Frontend Engineering at Palantir: Polar Scaled Tiles in Zodiac
Equal-angle lat/long map tiles collapse into tiny slivers near the poles on a 3D globe, so Zodiac, Palantir's Three.js globe library, was generating far too much geometry in polar regions. Polar scaled tiles fix this by using the spherical surface-area formula to merge adjacent tiles in power-of-2 spans until each is roughly as large as an equatorial tile. That breaks the 4-child quadtree assumption and forces client-side texture stitching from standard geodetic and Mercator tiles (Mercator is mapped in strips), heightmap resampling via bilinear interpolation, and blending toward fixed pole elevations. The result is over 90% fewer triangles, draw calls and textures at the poles and more consistent frame times, though texture fetching, up to 16 source tiles per polar tile, is now the bottleneck.
Related posts
- How We Built the BFCM 2023 Globe
Shopify Engineering mediumAdeptShopify's BFCM 2023 live-orders globe was built with Three.js and React-three-fiber, and most of its effects are drawn in single instanced draw calls. Order arcs are cubic Bézier curves evaluated in the vertex shader from per-instance attributes stored in an interleaved buffer. They are billboarded using the cross product of the curve tangent and the camera direction, and dissolve via UV-driven noise. Instancing let the team render tens of thousands of arcs, and up to a million on an M1 laptop, where earlier per-mesh arcs struggled past 1000 on mobile. The same approach covers fireworks, city dots and orbiting airplanes, along with fixes for a camera flip caused by the lookAt up vector, Hermite-spline 'loopy arcs', and working around WebGL's 255-byte attribute stride limit.
- Generate Vector Tiles with PostGIS
Supabase mediumAdeptPostGIS can generate Mapbox Vector Tiles on demand from Postgres rows, so a MapLibre GL client can render large point datasets while transferring only the data for the current viewport and zoom level. The pipeline downloads Overture Maps places as GeoJSON, converts them to SQL with GDAL ogr2ogr, and imports them into Supabase with psql. A plpgsql `mvt(z,x,y)` function then uses ST_TileEnvelope, ST_AsMVTGeom and ST_AsMVT to return base64-encoded tiles. A custom MapLibre `addProtocol` handler calls that function through supabase-js RPC. Payloads stay small because names and ids are included only above zoom 13, and detailed metadata is fetched on click instead of being encoded in the tiles.
- Are you using the right Mongo geospatial query?
Artsy Engineering mediumAdeptMongoDB's `$geoWithin` with `$center` computes radius queries in planar longitude/latitude space, so at Los Angeles's latitude a nominal 25km circle becomes an egg that drops points to the east and west. A Santa Monica gallery missing from Artsy's LA show listings was traced to this, and switching to `$centerSphere` with the radius in radians (km / 6378.1) fixed it. The investigation used Placemark to plot query results against a grid of test points and compare them with a geodesic circle. A postscript covers why the distortion happens, using the equirectangular and Mercator projections and Tissot's indicatrix.
- Introducing spatial CSS: A developer preview
WebKit mediumAdeptSafari on visionOS 27.3 ships a developer preview of the proposed spatial CSS API, which routes 3D scene composition through declarative CSS built around the `<model>` element. `spatial: portal` turns a container into a shared 3D space where child models are moved with true 3D `transform`, snapped together via `position-anchor` and `position-context: anchor` against named empties exported from tools like Blender, and lit with reusable `@environment-map` rules using equirectangular HDR images. `portal-action: orbit` lets users rotate the scene, and `requestVolumetricScene()` pops the portal out into a live-linked volumetric scene in the user's space. Because it is plain CSS, spatial layouts can respond to media queries and be animated or transitioned like any other property. The preview is enabled via the CSS Portals feature flag, and WebKit is asking developers for feedback.
- Visualizing Foursquare places with ClickHouse
ClickHouse mediumAdept
The Foursquare open places dataset (about 100 million records) loads straight from S3 Parquet into ClickHouse in 42 seconds and 11 GB. The table stores Web Mercator coordinates as materialized UInt32 columns, is ordered by a Morton (Z-order) space-filling curve, and has minmax indices so map tiles can be queried fast. The existing adsb.exposed air-traffic visualizer was reused with a 48-line change to render pixel-level tiles in the browser. Compared with Foursquare Studio's H3 hexagons, Kepler.gl and DuckDB-based maps, it gives higher resolution and smoother interactivity, but does not correct point density for latitude.