pg_twkb
TWKB tools etc
pg_twkb · TWKB tools etc
Overview
Usage
Sources:
- README at the reviewed commit
- Extension control file
- SQL API and indexed-tile implementation
- TWKB C entry points
- Server-side file writers
pg_twkb is an unfinished PostGIS-dependent toolkit for constructing indexed Tiny Well-Known Binary data sets. TWKB_IndexedTiles recursively partitions a geometry table into tiles and combines tile IDs with TWKB payloads; TWKB_Collect combines already encoded payload arrays.
Build an Indexed Payload
For a trusted table with an integer identifier and PostGIS geometry column:
Other installed functions include TWKB_MakeSquarebox, TWKB_DivideBox, TWKB_getTileId, overloaded TWKB_Write2File, and TWKB_Write2SQLite.
Caveats
- Upstream says the repository exists for personal versioning and that its functionality still needs documentation before it is usable. Version
0.1is old experimental code, not a supported interchange format or production tool. TWKB_Write2FileandTWKB_Write2SQLitewrite paths visible to the PostgreSQL server operating-system account. The install SQL grants no special protection; revokeEXECUTEfrom untrusted roles and never accept caller-controlled paths.- Both
TWKB_Write2Fileoverloads are incorrectly declaredIMMUTABLEdespite external file side effects. Do not use them in expressions where PostgreSQL may fold, duplicate, or reorder calls. - Indexed-tile functions construct dynamic SQL from table and column-name text. Supply only trusted identifiers and review permissions on the referenced relation.
- The control file requires
postgis, while the implementation uses historical PostGIS and PostgreSQL C APIs and has no current compatibility matrix. Test the exact build and validate consumers against the generated custom container.