{"id":18369173,"url":"https://github.com/ideal-postcodes/ospoint","last_synced_at":"2025-04-06T17:31:58.787Z","repository":{"id":11138342,"uuid":"13503413","full_name":"ideal-postcodes/ospoint","owner":"ideal-postcodes","description":"Converts Ordnance Survey grid references (Northings, Eastings) into Longitude and Latitude (OSGB36, ETRS89, WGS84)","archived":false,"fork":false,"pushed_at":"2021-04-29T07:42:50.000Z","size":577,"stargazers_count":24,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T23:35:19.393Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ideal-postcodes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-11T16:09:31.000Z","updated_at":"2024-01-27T21:51:39.000Z","dependencies_parsed_at":"2022-09-04T02:11:06.483Z","dependency_job_id":null,"html_url":"https://github.com/ideal-postcodes/ospoint","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideal-postcodes%2Fospoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideal-postcodes%2Fospoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideal-postcodes%2Fospoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideal-postcodes%2Fospoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ideal-postcodes","download_url":"https://codeload.github.com/ideal-postcodes/ospoint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247522457,"owners_count":20952555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T23:28:39.177Z","updated_at":"2025-04-06T17:31:58.119Z","avatar_url":"https://github.com/ideal-postcodes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI](https://github.com/ideal-postcodes/ospoint/workflows/CI/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/ideal-postcodes/ospoint/badge.svg?branch=master)](https://coveralls.io/github/ideal-postcodes/ospoint?branch=master)\n![Minified \u0026 Gzipped Size](https://img.shields.io/bundlephobia/minzip/ospoint.svg?style=flat)\n![Dependencies](https://img.shields.io/david/ideal-postcodes/ospoint.svg?style=flat)\n\n# Ordnance Survey Point Converter\n\n[![Try OsPoint on RunKit](https://badge.runkitcdn.com/ospoint.svg)](https://npm.runkit.com/ospoint)\n\nConverts Ordnance Survey grid points (UK National Grid, Northings \u0026 Eastings) into latitude and longitude.\n\nFor anyone who has ever tried to get useful location data from [Ordnance Survey's Code-Point Open](https://www.ordnancesurvey.co.uk/opendatadownload/products.html) but was stuck with Northings and Eastings, you can use this package to convert those numbers into longitude and latitude.\n\nOSPoint will allow you to convert Northings and Eastings into OSGB36, ETRS89 or WGS84 coordinates. If you're not sure which one you need, you probably just want WGS84.\n\nThis package is based on equations provided by the people at the Ordance Survey.\n\nOSPoint will accurately translate Northings and Eastings for the United Kingdom. \n\n**New** Now supports conversion of Irish National Grid coordinates. Please take care when transforming Irish coordinates - you will need to pass in the name of the [proper mercator projection](http://en.wikipedia.org/wiki/Irish_grid_reference_system) (as demonstrated below).\n\n## Getting Started\n\n```javascript\nconst OSPoint = require('ospoint');\n\n// Create a new OSPoint instance, with Northings \u0026 Eastings\nconst point = new OSPoint(\"NORTHINGS\", \"EASTINGS\");\n\n// Retrieve OSGB coordinates\npoint.toOSGB36();\n\n// Retrieve ETRS89 coordinates\npoint.toETRS89();\n\n// Retrieve WGS84 coordinates\npoint.toWGS84();\n```\n\nIf your Northings and Eastings data is a Irish National Grid coordinate, be sure to pass in `\"irish_national_grid\"` when converting. OSPoint will then use the appropriate mercator projection. For example:\n\n```javascript\nconst OSPoint = require('ospoint');\n\n// Create a new OSPoint instance, with Irish Northings \u0026 Eastings\nconst point = new OSPoint(\"NORTHINGS\", \"EASTINGS\");\n\n// Retrieve ETRS89 coordinates\npoint.toETRS89(\"irish_national_grid\");\n\n// Retrieve WGS84 coordinates\npoint.toWGS84(\"irish_national_grid\");\n```\n\n## Nota Bene\n\n- Northings and Eastings must be a number (no grid letters)\n- To be safe, you should pass in raw Northings and Eastings as strings. They occasionally come with a leading 0s from the OS dataset, which javascript will interpret as a base-8 number\n- All transformation methods return an object with longitude and latitude properties in decimal degrees\n\n## Testing\n\n```shell\nnpm test\n```\n\n## Note on ETRS89 and WGS84 Coordinate Systems\n\nETRS89 is a variation of WGS84 that takes into account the slow North Easterly drifting of the Eurasian tectonic plate. The WGS84 and ETRS89 coordinate systems coincided in 1989 (hence the name) and have drifted apart at a rate of ~2.5cm per year due to tectonic movements.\n\ntoWGS84() is currently hard-coded to output the same coordinates as toETRS89(). But in reality WGS and ETRS are [off by ~50-60cm in 2013](http://www.killetsoft.de/t_1009_e.htm).\n\n## Which Coordinate System do I want to translate Northings and Eastings into?\n\n95% of the time, people want WGS84\n\n## Licence\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fideal-postcodes%2Fospoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fideal-postcodes%2Fospoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fideal-postcodes%2Fospoint/lists"}