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 lists (or Numpy arrays) of lons, lats, or single values. Returns a list of Easting, Northing tuples as longs
util.convertlonlat_list() – pass lists (or Numpy arrays) of Eastings, Northings, or single values. Returns a list of longitude, latitude tuples as floats
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, convertlonlat
# 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(lons, lats)
# convert lists of BNG Eastings and Northings to longitude, latitude
eastings = [easting1, easting2, easting3]
northings = [northing1, northing2, northing3]
res_list_en = convertlonlat(eastings, northings)
# assumes numpy imported as np
lons_np = np.array(lons)
lats_np = np.array(lats)
res_list_np = convertbng(lons_np, lats_np)
Testing
Run nosetests (requires Nose)
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.25.tar.gz
(1.4 MB
view hashes)
Built Distribution
Close
Hashes for convertbng-0.1.25-cp27-none-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 981a2ac087715a9b3b7c452113f55074c85e4f0c8c4edd2f2fa69bca090a38f2 |
|
MD5 | 56a86223f278fcad9826e6b11a13c053 |
|
BLAKE2b-256 | 8355c613d7b0e89d7a37017375974b38cd3464eb947acb053f6697b1f0f00e44 |