Fast lon, lat to BNG conversion
Project description
Uses a Rust 1.x binary to perform fast longitude, latitude to BNG conversion.
This module exposes two 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)
Project details
Release history Release notifications | RSS feed
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.20.tar.gz
(1.6 MB
view hashes)
Built Distribution
Close
Hashes for convertbng-0.1.20-cp27-none-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b8155518cc2448ba7bc48036200bcb72ed6329482496290718496788bcb5554 |
|
MD5 | 9bc881d64eee3e48decb1eb73cb9467d |
|
BLAKE2b-256 | 10b5cabde57fdb4d59dd9543427a8ec4e83af5f43b0ca0552aa0fdb7f31c80f8 |