geometry_pyramid
geometry_pyramid · Build and refresh PostGIS vector tile pyramids with SQL.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102374 | geometry_pyramid | geometry_pyramid | 0.1.3 | GIS | MIT | Rust |
PostgreSQL · 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | postgis |
Usage
Sources:
- Version 0.1.3 guide
- Release and packaged installation SQL
- Control file
- Catalog definitions
- Lifecycle functions
- Tile access
- Storage checks
- Worker execution context
geometry_pyramid builds materialized vector tiles over PostGIS geometry tables and returns MVT bytes through SQL. Version 0.1.3 supports PostgreSQL 15–18 and requires PostGIS 3.1 or later with MVT/protobuf support. It installs into public and is not relocatable. It uses a native library without requiring shared preload or an external daemon.
Build and read tiles
Table, column and pyramid names must be bare ASCII identifiers of at most 45 characters; schema-qualified names are rejected. Keep a stable feature ID and a GiST geometry index. Output tiles use Web Mercator; set sourceSRS when the source coordinate system differs from the default 4326.
ST_Tile returns bytea, or NULL for an empty, missing or out-of-bounds tile. With splitSize above zero, sparse tiles are generated on demand. dynamicBeyondMaxZoom controls on-demand slicing above the materialized maximum. attributes and buildRules control tile properties and per-zoom filtering. parallel selects build concurrency; workers need available PostgreSQL worker slots and committed source data. tileSizeBudgetBytes cannot be combined with parallel builds. Start with a bounded zoom range: the default maximum zoom of 18 can imply substantial work.
Refresh and remove
Refreshes are explicit, rather than automatic triggers. For moved or deleted features, refresh an extent covering both old and new locations; a predicate cannot rediscover a deleted feature. Rebuilding an existing pyramid preserves its published storage relation. Drop the pyramid before dropping its source table.
Privileges and upgrades
Functions run with the caller’s privileges. Builds require source reads, a writable output schema, and appropriate access to geometry_pyramid_catalog, geometry_pyramid_stats and the tile tables. The installation SQL does not grant these table privileges to application roles. Cached tiles are stored data: permission to read a tile table exposes its materialized contents independently of later source-row policy changes. Grant access accordingly and refresh stale data. Replacing tile storage is rejected when an active RLS policy filters its rows.
buildRules[].filter and the predicate passed to ST_UpdatePyramid are trusted SQL expressions evaluated as the caller; never pass untrusted input directly. Worker execution preserves the effective role, search path and row-security context.
Stop extension work, install the matching library and reconnect sessions before upgrading. On Windows, stop PostgreSQL before replacing a loaded DLL. PostgreSQL 13–14 must be upgraded before using this release.
Upgrades from 0.1.1 or 0.1.2 need no tile rebuild. From 0.1.0, perform the update and explicit source_rel/storage_rel bindings in one transaction using the official migration example; verify no registered pyramid has an unbound relation before committing. These bindings use regclass to prevent later search-path substitution.