skillfed

convertbng

Fast lon, lat to and from ETRS89 and BNG (OSGB36) using the OS OSTN15 transform via Rust FFI

convertbng v1.0.0 100.3K downloads/30d#12,997 on PyPI41
License unclear BlueOak-1.0.0 Active released

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 convertbng

uv

uv add convertbng

poetry

poetry add convertbng

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: GISTopic :: Software Development :: Libraries :: Python Modules

Tags

WGS84 to BNG conversionlongitude latitude to grid coordinatesOSGB36 ETRS89 transformBritish National Grid convertercoordinate system conversiongeospatial coordinate transformOSTN15 correction
geospatialcoordinate-transformgis

More Python Modules packages