Skip to main content
Uses a Rust 1.x binary to perform fast longitude, latitude to BNG conversion.
This module exposes three methods:
util.convertbng() – pass a lon, lat. Returns a tuple of Eastings, Northings
util.convertbng_list() – pass lists (or Numpy arrays) of lons, lats.
util.convertlonlat_list() – pass lists (or Numpy arrays) of Eastings, Northings.

The first two methods return Easting, Northing tuples (in a list in the case of the latter), while the third method returns a list of lon, lat tuples.

Installation

Installation as a binary wheel using pip, for OS X:
pip install convertbng
Binary wheels aren’t yet available for Linux or Windows, but installation directly from Github works:
pip install git+git://github.com/urschrei/convertbng.git

Usage

from convertbng.util import convertbng, convertbng_list, convertlonlat_list

# convert a single value
res = convertbng(lon, lat)

# convert lists of longitude and latitude values to BNG Eastings and Northings
lons = [lon1, lon2, lon3]
lats = [lat1, lat2, lat3]
res_list = convertbng_list(lons, lats)

# convert lists of BNG Eastings and Northings to longitude, latitude
eastings = [easting1, easting2, easting3]
northings = [northing1, northing2, northing3]
res_list_en = convertlonlat_list(eastings, northings)

# assumes numpy imported as np
lons_np = np.array(lons)
lats_np = np.array(lats)
res_list_np = convertbng_list(lons_np, lats_np)

Testing

Run nosetests (requires Nose)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

convertbng-0.1.21.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

convertbng-0.1.21-cp27-none-macosx_10_6_intel.whl (1.4 MB view details)

Uploaded CPython 2.7macOS 10.6+ Intel (x86-64, i386)

File details

Details for the file convertbng-0.1.21.tar.gz.

File metadata

  • Download URL: convertbng-0.1.21.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for convertbng-0.1.21.tar.gz
Algorithm Hash digest
SHA256 1f1b9651dc52edaf62240ccf9270a6b241fbc1725f12799cbe7816c43d8986d1
MD5 d8d69921648878e0d306925fbe2db64a
BLAKE2b-256 01dae7f3e1ac1d0b32ce66e5c91fd95deb9384a6e4431a17d944105ff0b66c2a

See more details on using hashes here.

File details

Details for the file convertbng-0.1.21-cp27-none-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for convertbng-0.1.21-cp27-none-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 90651c52bb82d0ac39140a2b9e1e3cef49d5b9c9a47fcbe601d9ea2d6c9e63c1
MD5 86275164b96c3262caf2b960a2ce0cbf
BLAKE2b-256 a84f01a66176eea84f06daa75688b0e441e6bae467f77cf2f5188de5654dff83

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page