@@ -197,16 +197,34 @@ def __init__(self, initstring=None, **kwargs):
197
197
198
198
def fwd (self , lons , lats , az , dist , radians = False ):
199
199
"""
200
- forward transformation - Returns longitudes, latitudes and back
201
- azimuths of terminus points given longitudes (lons) and
202
- latitudes (lats) of initial points, plus forward azimuths (az)
203
- and distances (dist).
200
+ Forward transformation
204
201
205
- Works with numpy and regular python array objects, python
206
- sequences and scalars.
202
+ Determine longitudes, latitudes and back azimuths of terminus
203
+ points given longitudes and latitudes of initial points,
204
+ plus forward azimuths and distances.
207
205
208
- if radians=True, lons/lats and azimuths are radians instead of
209
- degrees. Distances are in meters.
206
+ Parameters
207
+ ----------
208
+ lons: array, :class:`numpy.ndarray`, list, tuple, or scalar
209
+ Longitude(s) of initial point(s)
210
+ lats: array, :class:`numpy.ndarray`, list, tuple, or scalar
211
+ Latitude(s) of initial point(s)
212
+ az: array, :class:`numpy.ndarray`, list, tuple, or scalar
213
+ Forward azimuth(s)
214
+ dist: array, :class:`numpy.ndarray`, list, tuple, or scalar
215
+ Distance(s) between initial and terminus point(s)
216
+ in meters
217
+ radians: bool, optional
218
+ If True, the input data is assumed to be in radians.
219
+
220
+ Returns
221
+ -------
222
+ array, :class:`numpy.ndarray`, list, tuple, or scalar:
223
+ Longitude(s) of terminus point(s)
224
+ array, :class:`numpy.ndarray`, list, tuple, or scalar:
225
+ Latitude(s) of terminus point(s)
226
+ array, :class:`numpy.ndarray`, list, tuple, or scalar:
227
+ Back azimuth(s)
210
228
"""
211
229
# process inputs, making copies that support buffer API.
212
230
inx , xisfloat , xislist , xistuple = _copytobuffer (lons )
@@ -222,15 +240,33 @@ def fwd(self, lons, lats, az, dist, radians=False):
222
240
223
241
def inv (self , lons1 , lats1 , lons2 , lats2 , radians = False ):
224
242
"""
225
- inverse transformation - Returns forward and back azimuths, plus
226
- distances between initial points (specified by lons1, lats1) and
227
- terminus points (specified by lons2, lats2).
243
+ Inverse transformation
228
244
229
- Works with numpy and regular python array objects, python
230
- sequences and scalars.
245
+ Determine forward and back azimuths, plus distances
246
+ between initial points and terminus points.
247
+
248
+ Parameters
249
+ ----------
250
+ lons1: array, :class:`numpy.ndarray`, list, tuple, or scalar
251
+ Longitude(s) of initial point(s)
252
+ lats1: array, :class:`numpy.ndarray`, list, tuple, or scalar
253
+ Latitude(s) of initial point(s)
254
+ lons2: array, :class:`numpy.ndarray`, list, tuple, or scalar
255
+ Longitude(s) of terminus point(s)
256
+ lats2: array, :class:`numpy.ndarray`, list, tuple, or scalar
257
+ Latitude(s) of terminus point(s)
258
+ radians: bool, optional
259
+ If True, the input data is assumed to be in radians.
231
260
232
- if radians=True, lons/lats and azimuths are radians instead of
233
- degrees. Distances are in meters.
261
+ Returns
262
+ -------
263
+ array, :class:`numpy.ndarray`, list, tuple, or scalar:
264
+ Forward azimuth(s)
265
+ array, :class:`numpy.ndarray`, list, tuple, or scalar:
266
+ Back azimuth(s)
267
+ array, :class:`numpy.ndarray`, list, tuple, or scalar:
268
+ Distance(s) between initial and terminus point(s)
269
+ in meters
234
270
"""
235
271
# process inputs, making copies that support buffer API.
236
272
inx , xisfloat , xislist , xistuple = _copytobuffer (lons1 )
@@ -246,13 +282,10 @@ def inv(self, lons1, lats1, lons2, lats2, radians=False):
246
282
247
283
def npts (self , lon1 , lat1 , lon2 , lat2 , npts , radians = False ):
248
284
"""
249
- Given a single initial point and terminus point (specified by
250
- python floats lon1,lat1 and lon2,lat2), returns a list of
251
- longitude/latitude pairs describing npts equally spaced
252
- intermediate points along the geodesic between the initial and
253
- terminus points.
254
-
255
- if radians=True, lons/lats are radians instead of degrees.
285
+ Given a single initial point and terminus point, returns
286
+ a list of longitude/latitude pairs describing npts equally
287
+ spaced intermediate points along the geodesic between the
288
+ initial and terminus points.
256
289
257
290
Example usage:
258
291
@@ -297,6 +330,27 @@ def npts(self, lon1, lat1, lon2, lat2, npts, radians=False):
297
330
'47.136 -109.100'
298
331
'46.805 -114.051'
299
332
'46.262 -118.924'
333
+
334
+ Parameters
335
+ ----------
336
+ lon1: float
337
+ Longitude of the initial point
338
+ lat1: float
339
+ Latitude of the initial point
340
+ lon2: float
341
+ Longitude of the terminus point
342
+ lat2: float
343
+ Latitude of the terminus point
344
+ npts: int
345
+ Number of points to be returned
346
+ radians: bool, optional
347
+ If True, the input data is assumed to be in radians.
348
+
349
+ Returns
350
+ -------
351
+ list of tuples:
352
+ list of (lon, lat) points along the geodesic
353
+ between the initial and terminus points.
300
354
"""
301
355
lons , lats = super ()._npts (lon1 , lat1 , lon2 , lat2 , npts , radians = radians )
302
356
return list (zip (lons , lats ))
@@ -508,7 +562,7 @@ def geometry_area_perimeter(self, geometry, radians=False):
508
562
radians: bool, optional
509
563
If True, the input data is assumed to be in radians.
510
564
511
- Returns
565
+ Returns
512
566
-------
513
567
(float, float):
514
568
The geodesic area (meters^2) and permimeter (meters) of the polygon.
0 commit comments