https://github.com/firstclasspostcodes/osgb
https://github.com/firstclasspostcodes/osgb
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/firstclasspostcodes/osgb
- Owner: firstclasspostcodes
- Created: 2020-01-09T14:50:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-19T07:23:05.000Z (about 5 years ago)
- Last Synced: 2025-02-28T21:16:51.537Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 663 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OSGB

This tiny JS library is used as a helper library to convert between both OSGB and WGS84 geo-cordinate systems. It provides two exported functions `toLatLng()` and `toEastingNorthing()`.
## Installation
The CLI can be installed globally, using:
```
npm i -g @firstclasspostcodes/osgb
```
## Usage
```js
const { toLatLng, toEastingNorthing } = require('@firstclasspostcodes/osgb');
const position = {
latitude: 51.5018949,
longitude: -0.2107977,
};
const osgb = toEastingNorthing(position);
const { easting, northing } = osgb;
const wgs84 = toLatLng({ easting, northing });
```