Parse Ordnance Survey Great Britain alpha-numeric grid references into a bounding box
npm install @astuntech/gridref-jsParse Ordnance Survey Great Britain alpha numeric grid references into a bounding box.
``shell`
npm i @astuntech/gridref-js
`javascript
import { parse, InvalidGridRef } from "@astuntech/gridref-js";
let gridRef = "SU387148";
let bbox = null;
try {
bbox = parse(gridRef);
console.log(bbox);
} catch (e) {
if (e instanceof InvalidGridRef) {
console.error(e.message);
} else {
throw e;
}
}
`
Array.<Number>) to bounding box in
British National Grid ([438700, 114800, 438800, 114900]`)Kind: global function
Returns: Array.<Number> - Bounding box of grid reference in metres
| Param | Type | Description |
| --- | --- | --- |
| gridref | String | Standard format OSGB grid reference (e.g. SU387148) |
Derived from https://github.com/peterhaldbaek/mt-osgridref
MIT