{"id":21187030,"url":"https://github.com/thunderstruct/pybng","last_synced_at":"2025-03-14T20:19:33.130Z","repository":{"id":62579019,"uuid":"237613520","full_name":"ThunderStruct/PyBNG","owner":"ThunderStruct","description":"An Ordinance-Survey National Grid (BNG) coordinates converter for Python 3","archived":false,"fork":false,"pushed_at":"2020-03-10T15:22:40.000Z","size":82,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T13:07:25.558Z","etag":null,"topics":["bng","converter","coordinates","gis","ordinance-survey","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThunderStruct.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-01T12:44:28.000Z","updated_at":"2023-01-09T17:44:33.000Z","dependencies_parsed_at":"2022-11-03T20:48:31.558Z","dependency_job_id":null,"html_url":"https://github.com/ThunderStruct/PyBNG","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThunderStruct%2FPyBNG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThunderStruct%2FPyBNG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThunderStruct%2FPyBNG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThunderStruct%2FPyBNG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThunderStruct","download_url":"https://codeload.github.com/ThunderStruct/PyBNG/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639558,"owners_count":20323511,"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":["bng","converter","coordinates","gis","ordinance-survey","python","python3"],"created_at":"2024-11-20T18:28:01.291Z","updated_at":"2025-03-14T20:19:33.105Z","avatar_url":"https://github.com/ThunderStruct.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyBNG\n[![Build Status](https://travis-ci.org/ThunderStruct/PyBNG.svg?branch=master)](https://travis-ci.org/ThunderStruct/PyBNG) [![pypi](https://img.shields.io/badge/pypi%20package-0.1.8-lightgrey.svg)](https://pypi.org/project/PyBNG/0.1.8/) [![Python](https://img.shields.io/badge/python-3.5^-blue.svg)](https://github.com/ThunderStruct/PyBNG) [![License](https://img.shields.io/cocoapods/l/AFNetworking.svg)](https://github.com/ThunderStruct/PyBNG/blob/master/LICENSE)\n\nAn Ordinance-Survey National Grid coordinates converter\n\n------------------------\n\n## Getting Started\nPyBNG is built on top of [OSGridConverter](https://github.com/jdstmporter/OSGridConverter/) and is used to convert coordinates from the Ordnance Survey National Grid system (often called the British National Grid -- *BNG*) to latitude and longitude using `WGS84` (other geodetic reference systems available).\n\nWhile OSGridConverter can convert BNG to latitude and longitude, it does not support all-numeric grid references, which is the primary feature in this library.\n\n### Installation\n#### PIP (recommended)\n\n```sh\npip install PyBNG\n```\n#### Manual Installation\nSimply clone the entire repo and extract the files in the `PyBNG` folder, then copy all the content to your project folder\n\nOr use one of the shorthand methods below\n##### GIT\n  - `cd` into your project directory\n  - Use `sparse-checkout` to pull the library files only into your project directory\n    ```sh\n    git init PyBNG\n    cd PyBNG\n    git remote add -f origin https://github.com/ThunderStruct/PyBNG.git\n    git config core.sparseCheckout true\n    echo \"PyBNG/*\" \u003e\u003e .git/info/sparse-checkout\n    git pull --depth=1 origin master\n    ```\n   - Import the newly pulled files into your project folder\n\n##### SVN\n  - `cd` into your project directory\n  - `checkout` the library files\n    ```sh\n    svn checkout https://github.com/ThunderStruct/PyBNG/trunk/PyBNG\n    ```\n  - Import the newly checked out files into your project folder\n  \n\n### Usage\n#### Initialization\nA `PyBNG` object can be instantiated as follows:\n\n```python\nfrom PyBNG import PyBNG\n\nbng = PyBNG(easting=519080, northing=185050)\n\nlatlon = PyBNG(lat=51.55178424773851, lon= -0.2835125528796557)\n```\nThe initializer expects `easting` and `northing` *OR* `lat` and `lon` parameters, depending on the required conversion\n\n\n### Methods\n\n  - `get_latlon(datum='WGS84')`:\n    - Description: calculates the latitude and logitude based on the given BNG coordinates\n    - Parameters: none (passed to constructor)\n    - Return Value: tuple -- (latitude, longitude)\n    - Usage: \n        ```python\n        from PyBNG import PyBNG\n\n        bng = PyBNG(easting=519080, northing=185050)\n        bng.get_latlon()     # (51.55178424773851, -0.2835125528796557)\n        ```\n  - `get_bng(datum='WGS84')`:\n    - Description: calculates the BNG coordinates given a latitude and a longitude\n    - Parameters: none (passed to constructor)\n    - Return Value: typle -- (easting, northing)\n    - Usage: \n        ```python\n        from PyBNG import PyBNG\n\n        latlon = PyBNG(lat=51.55178424773851, lon= -0.2835125528796557)\n        latlon.get_bng()     # (519107, 185051)\n        ```\n*Please note that converting BNG coordinates to latitude/longitude and back to BNG will yield different results due to internal float rounding*\n\n### Acknowledgment\nI would like to thank [Dr. Lakshmi Babu-Saheer](mailto:lakshmi.babu-saheer@anglia.ac.uk) for her unwavering support, encouragement, and advice. \n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/ThunderStruct/PyBNG/blob/master/LICENSE) file for details\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunderstruct%2Fpybng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthunderstruct%2Fpybng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunderstruct%2Fpybng/lists"}