Home | Trees | Indices | Help |
|
---|
|
Handle 2-d NumPy or other arrays as LatLons or as pseudo-x/-ys.
NumPy arrays are assumed to contain rows of points with a lat-, a longitude -and possibly other- values in different columns. While iterating over the array rows, create an instance of a given LatLon class "on-the-fly" for each row with the row's lat- and longitude.
The original NumPy array is read-accessed only and never duplicated, except to create a subset of the original array.
For example, to process a NumPy array, wrap the array by instantiating class Numpy2LatLon and specifying the column index for the lat- and longitude in each row. Then, pass the Numpy2LatLon instance to any pygeodesy function or method accepting a points argument.
Tested with 64-bit Python 2.6.9 (and numpy 1.6.2), 2.7.13 (and numpy 1.13.1), 3.5.3 and 3.6.2 on macOS 10.12.6 Sierra, with 64-bit Intel-Python 3.5.3 (and numpy 1.11.3) on macOS 10.12.6 Sierra and with Pythonista 3.1 using 64-bit Python 2.7.12 and 3.5.1 (both with numpy 1.8.0) on iOS 10.3.3.
Version: 17.09.14
Classes | |
LatLon2psxy Wrapper for LatLon points as "on-the-fly" pseudo-xy coordinates. |
|
Numpy2LatLon Wrapper for NumPy arrays as "on-the-fly" LatLon points. |
Functions | |||
|
|||
|
|||
|
Function Details |
Determine the lower-left and upper-right corners of a polygon defined by a list, sequence, set or tuple of LatLon points.
Example: >>> b = LatLon(45,1), LatLon(45,2), LatLon(46,2), LatLon(46,1) >>> bounds(b) # False >>> 45.0, 1.0, 46.0, 2.0 |
Determine the direction of a polygon defined by an array, list, sequence, set or tuple of LatLon points.
Example: >>> f = LatLon(45,1), LatLon(45,2), LatLon(46,2), LatLon(46,1) >>> isclockwise(f) # False >>> t = LatLon(45,1), LatLon(46,1), LatLon(46,2) >>> isclockwise(t) # True |
Determine whether a polygon defined by an array, list, sequence, set or tuple of LatLon points is convex.
Example: >>> t = LatLon(45,1), LatLon(46,1), LatLon(46,2) >>> isconvex(t) # True >>> f = LatLon(45,1), LatLon(46,2), LatLon(45,2), LatLon(46,1) >>> isconvex(f) # False |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Sep 16 13:05:24 2017 | http://epydoc.sourceforge.net |