pg_osgr
pg_osgr · Ordnance Survey grid reference handling for biological recording
Overview
| Relationships | |
|---|---|
| Requires | plpgsql |
Usage
Sources:
- Upstream README at the reviewed commit
- Version 1.1.0 SQL API
- Grid-reference conversion documentation
- Extension control file
pg_osgr is a pure-PL/pgSQL toolkit for converting Ordnance Survey grid references to easting, northing, datum, and accuracy, and for constructing references from those components.
The generic functions detect or accept EPSG 27700 for Great Britain, EPSG 29901 for Ireland and Northern Ireland, and EPSG 32630 for the Channel Islands. Resolution is limited to powers of ten and does not go below one metre.
The extension parses and formats grid references; it does not perform general coordinate-system transformations or datum shifts. Keep the EPSG code with stored coordinates, validate references at coverage boundaries, and use PostGIS/PROJ when converting between coordinate reference systems. Upstream states the rules were current on 2023-08-01, so verify later specification changes for regulated datasets.