Fast lon, lat to BNG conversion
Project description
Fast lon, lat to BNG conversion
===============================
Uses a Rust 1.x binary to perform fast longitude, latitude to `BNG <https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid>`_ conversion, and vice versa.
|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.
|Both methods return Easting, Northing tuples (in a list in the case of the latter).
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
=====
.. code-block:: python
from convertbng.util import convertbng, convertbng_list, convertlonlat_list
res = convertbng(lon, lat)
lons = [lon1, lon2, lon3]
lats = [lat1, lat2, lat3]
eastings = [easting1, easting2, easting3]
northings = [northing1, northing2, northing3]
# assumes numpy imported as np
lons_np = np.array(lons)
lats_np = np.array(lats)
res_list = convertbng_list(lons, lats)
res_list_np = convertbng_list(lons_np, lats_np)
res_list_en = convertlonlat_list(eastings, northings)
===============================
Uses a Rust 1.x binary to perform fast longitude, latitude to `BNG <https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid>`_ conversion, and vice versa.
|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.
|Both methods return Easting, Northing tuples (in a list in the case of the latter).
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
=====
.. code-block:: python
from convertbng.util import convertbng, convertbng_list, convertlonlat_list
res = convertbng(lon, lat)
lons = [lon1, lon2, lon3]
lats = [lat1, lat2, lat3]
eastings = [easting1, easting2, easting3]
northings = [northing1, northing2, northing3]
# assumes numpy imported as np
lons_np = np.array(lons)
lats_np = np.array(lats)
res_list = convertbng_list(lons, lats)
res_list_np = convertbng_list(lons_np, lats_np)
res_list_en = convertlonlat_list(eastings, northings)
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.18.tar.gz
(1.8 MB
view hashes)
Built Distribution
Close
Hashes for convertbng-0.1.18-cp27-none-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0d710eae5217d8d3507e968e67d0d048571d2ff63e646c44b35a622b1030206 |
|
MD5 | 630224cdabb1c30016e71b30be3ac38f |
|
BLAKE2b-256 | 1e7281d7284417a66022ac09be43d5aea54bfb9030d18b0a336d8eea53d504be |