@@ -222,19 +222,32 @@ def paste_image(fn, xpos, ypos, out):
222
222
out [yoff : yoff + col .shape [1 ], xoff : xoff + col .shape [0 ]] = col
223
223
224
224
225
- def latlon_to_3D ( lat , lon , alt = 0 ):
225
+ def lonlat_to_3D ( lon , lat , alt = 0 ):
226
226
"""
227
227
Convert lat/lon coord to 3D coordinate for visualisation
228
228
Uses simple spherical earth rather than true ellipse
229
229
see http://www.mathworks.de/help/toolbox/aeroblks/llatoecefposition.html
230
230
https://stackoverflow.com/a/20360045
231
231
"""
232
- return latlon_to_3D_true ( lat , lon , alt , flattening = 0.0 )
232
+ return lonlat_to_3D_true ( lon , lat , alt , flattening = 0.0 )
233
233
234
234
235
- def latlon_to_3D_true (lat , lon , alt = 0 , flattening = 1.0 / 298.257223563 ):
235
+ def latlon_to_3D (lat , lon , alt = 0 , flattening = 0.0 ):
236
236
"""
237
- Convert lat/lon coord to 3D coordinate for visualisation
237
+ Convert lon/lat coord to 3D coordinate for visualisation
238
+
239
+ Provided for backwards compatibility as main function now reverses arg order of
240
+ (lat, lon) to (lon, lat)
241
+ """
242
+ return lonlat_to_3D_true (lon , lat , alt , flattening )
243
+
244
+
245
+ def lonlat_to_3D_true (lon , lat , alt = 0 , flattening = 1.0 / 298.257223563 ):
246
+ """
247
+ Convert lon/lat coord to 3D coordinate for visualisation
248
+ Now using longitude, latitude, altitude order for more natural argument order
249
+ longitude=x, latitude=y, altitude=z
250
+
238
251
Uses flattening factor for elliptical earth
239
252
see http://www.mathworks.de/help/toolbox/aeroblks/llatoecefposition.html
240
253
https://stackoverflow.com/a/20360045
0 commit comments