postgrids
postgrids · pgrx extension for parsing, formatting, and changing the precision of British OSGB and Irish OSI national grid references.
Overview
PostgreSQL · 12, 13, 14, 15, 16, 17
Usage
Sources:
postgrids version 0.0.0 provides PostgreSQL types and helper functions for British OSGB and Irish OSI national-grid references. It parses, validates, formats, and changes grid-reference precision; it does not convert references to PostGIS geometries or other coordinate systems.
Core Workflow
The equivalent Irish functions use the osi_ prefix:
Objects
The custom types are OSGB and OSI. Each family provides *_from_string, *_from_eastings_northings, *_is_valid, *_precision, and *_recalculate.
Precision is expressed in metres. Supported values are 1, 10, 100, 1000, 2000, 10000, and 100000; unsupported values raise an error. Parsing constructors also raise on invalid references, while the *_is_valid helpers return a boolean.
Maturity Boundary
The upstream README describes the project as very much work in progress and explicitly says conversion to geospatial primitives is not yet supported. Pin the extension build and verify accepted grid-reference forms before storing these custom types durably.