convertbng
Fast lon, lat to and from ETRS89 and BNG (OSGB36) using the OS OSTN15 transform via Rust FFI
What it is and what it does
convertbng is a Python wrapper around a Rust library that performs fast, accurate coordinate system transformations between WGS84 (decimal longitude/latitude) and two British/European grid systems: OSGB36 (British National Grid) and ETRS89. It uses the OS OSTN15 transformation for high accuracy when converting to BNG, and offers a faster direct projection option for ETRS89. The package accepts flexible input formats—single values, lists, tuples, numpy arrays, or any iterable—and returns results as lists of two lists (eastings and northings, or vice versa).
The library is built as pre-compiled wheels for common platforms, so installation is straightforward and requires no compilation. It depends only on numpy and is designed for geospatial applications where accurate coordinate conversion between global WGS84 and UK/European grid systems is needed. The Rust backend ensures conversion speed even on large datasets, with optional Cython functions available for further performance gains on numpy arrays.
Use it for:
- Convert GPS coordinates to British National Grid for UK mapping applications
- Transform survey data from WGS84 to ETRS89 for European geospatial analysis
- Batch-process coordinate lists to align with UK ordnance survey data
- Integrate coordinate transformation into GIS workflows mixing WGS84 and BNG systems
- Validate that coordinates fall within the BNG bounding box before mapping
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts decimal WGS84 longitude/latitude coordinates to and from British National Grid (OSGB36) and ETRS89 coordinates using Rust FFI for speed.
Yes, if you need accurate WGS84 to British National Grid or ETRS89 conversion. The package is actively maintained, has no known vulnerabilities, and offers fast Rust-backed performance with convenient Python APIs. The unclear license treatment warrants a quick verification, but the BlueOak-1.0.0 SPDX identifier suggests permissive licensing. Install friction is moderate due to compiled binaries, but pre-built wheels eliminate compilation for standard platforms.
Install
convertbng on PyPI
pip
pip install convertbnguv
uv add convertbngpoetry
poetry add convertbngInstalling convertbng
Before you install
Medium install friction due to compiled Rust binaries, but pre-built wheels are available for common platforms (Linux x86_64/aarch64, macOS x86_64/arm64, Windows 64-bit). Requires Python 3.10+. Package is actively maintained with recent releases.
License in practice
License treatment is marked unclear in the metadata; the SPDX identifier is BlueOak-1.0.0, which is a permissive open-source license, but you should verify the actual license terms before use.
Quickstart
pip install convertbng
from convertbng.util import convert_bng, convert_lonlat
import numpy as np
# Convert single coordinates
res = convert_bng(lon, lat)
# Convert arrays
lons = np.array([lon1, lon2])
lats = np.array([lat1, lat2])
res_list = convert_bng(lons, lats)
Requires Python 3.10 or later. Pre-built wheels available for Linux, macOS, and Windows 64-bit; other platforms require building from source with the lonlat_bng Rust library.
Verify before relying
- Whether BlueOak-1.0.0 license is compatible with your project's licensing requirements
- Performance characteristics on large coordinate arrays compared to alternatives
- Whether OSTN15 coverage is sufficient for your geographic region of interest
Package facts
| License | BlueOak-1.0.0 (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 67 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 100,265/month — #12,997 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: convertbng-1.0.0-cp310-cp310-macosx_11_0_arm64.whl; convertbng-1.0.0-cp310-cp310-macosx_11_0_x86_64.whl; convertbng-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl; convertbng-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl; convertbng-1.0.0-cp310-cp310-win_amd64.whl; convertbng-1.0.0-cp311-abi3-macosx_11_0_arm64.whl; convertbng-1.0.0-cp311-abi3-macosx_11_0_x86_64.whl; convertbng-1.0.0-cp311-abi3-manylinux_2_28_aarch64.whl; convertbng-1.0.0-cp311-abi3-manylinux_2_28_x86_64.whl; convertbng-1.0.0-cp311-abi3-win_amd64.whl
Keywords: Geo, OSTN02, OSTN15, BNG, OSGB36, GIS
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
utmConverts between latitude/longitude coordinates…
permissive · top 5,000 on PyPI
mgrsConverts between MGRS (Military Grid Reference…
permissive · top 15,000 on PyPI
reverse_geocoderReverse Geocoder converts latitude/longitude…
copyleft · top 15,000 on PyPI
lat-lon-parserParses latitude-longitude coordinate strings in…
permissive · top 15,000 on PyPI
geohash2Encodes latitude/longitude coordinates to…
agpl · top 5,000 on PyPI
reverse-geocodeReverse Geocode converts latitude/longitude…
copyleft · top 15,000 on PyPI
pyGeoTileConverts between geographic coordinate systems…
permissive · top 15,000 on PyPI
morecantileConstruct and work with map tile grids…
permissive · top 15,000 on PyPI
timezonefinderLooks up the timezone for any WGS84 coordinate…
unclear · top 5,000 on PyPI
tzfpyConverts geographic coordinates…
permissive · top 5,000 on PyPI