Skip to content

geotini_postgis

PostGIS geometry wrappers for geotini encoding

geotini · PostGIS geometry wrappers for geotini encoding

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102481geotini_postgisgeotini0.1.0GISMITSQL

PostgreSQL · 15, 16, 17, 18, 19

Relationships
Requiresgeotini postgis

Usage

Sources:

geotini_postgis 0.1.0 is the unpublished SQL companion to the native geotini extension. Its control requires geotini and postgis, uses the fixed geotini schema, and sets superuser=false. Enable it with the privileges needed to create its functions in that schema after installing both prerequisites. It inherits the native PostgreSQL 15–19 boundary, loads no extra library and needs no preload or restart.

CREATE EXTENSION postgis;
CREATE EXTENSION geotini;
CREATE EXTENSION geotini_postgis;
WITH encoded AS (
  SELECT geotini.geotini_encode(
    ST_SetSRID(ST_MakePoint(13.40495, 52.52001), 4326), 6) AS value
)
SELECT value, ST_AsText(geotini.geotini_decode_geometry(value, 4326))
FROM encoded;

Geometry conversion

geotini_encode(geometry, ...) wraps binary geometry encoding; its options are precision (default 5, range 0–15), z_precision and m_precision (default -1 to inherit), checksum (false), and favor (default, size, or speed). geotini_decode_geometry(text, srid) returns a PostGIS geometry, defaulting to SRID 4326. The SQL installer records PostGIS’s actual schema in its function bodies, avoiding dependence on the caller’s search path.

Encoding drops SRID without transforming coordinates. Transform inputs explicitly with ST_Transform when necessary. Decoding assigns the requested SRID without transforming coordinates; use 0 for none. Encoding rounds coordinates to the selected precision. Both wrappers are immutable, strict and parallel safe and may be used in generated columns or expression indexes.

Boundaries and upgrades

Geometry support follows the native codec’s GeoJSON-compatible types. Curves, surfaces, TINs, triangles and XYM geometries are unsupported. Invalid strings raise SQLSTATE 22P02; invalid encoder input raises 22023. The current format-transition commit says non-JavaScript implementations still need porting, so cross-language compatibility and stable archival representation must not be assumed. No upgrade scripts exist for this first source version. The plain PL/pgSQL alternative is a different installation path with the same function names; do not install it over the native family.

Table reader