Use paulcager/osgridref to translate

This commit is contained in:
Paul Cager
2020-12-13 23:25:17 +00:00
parent c5c04d7942
commit 814928e1b8
9 changed files with 172 additions and 494 deletions
+7 -7
View File
@@ -1,7 +1,7 @@
# osgrid-server - _Ordnance Survey Grid Ref Converter_
This project implements a simple REST server to expose the excellent https://www.movable-type.co.uk/scripts/latlong-os-gridref.html
Ordnance Survey grid reference conversion utilities.
This project implements a simple REST server to allow conversion between Ordnance Survey
grid references and latitude / longitude.
## Usage
@@ -9,13 +9,13 @@ The easiest way to avoid environmental or Node versioning problems is to start t
docker run -d --rm --name osgrid-server -p 9090:9090 paulcager/osgrid-server
A grid reference may then be converted to a lat /lon:
A grid reference may then be converted to a lat / lon:
$ curl http://localhost:9090/gridref/SU3724515505
50.93779289256305,-1.471309033422234
$ curl http://localhost:9090/v4/gridref/SU37241550
{"osGridRef":"SU37241550","easting":437240,"northing":115500,"lat":50.93774069083967,"lon":-1.4713807843405298}
Or a lat/lon converted to a grid reference:
$ curl http://localhost:9090/latlon/50.9378,-1.4713
SU 37245 15505
$ curl http://localhost:9090/v4/latlon/50.9378,-1.4713
{"osGridRef":"SU37241550","easting":437246,"northing":115507,"lat":50.9378,"lon":-1.4713}