Hi srs20,
you can use this macro in macros.conf :
[distance(4)]
args = lat1,lon1,lat2,lon2
definition = eval rlat1 = pi()*$lat1$/180, rlat2=pi()*$lat2$/180, rlat = pi()*($lat2$-$lat1$)/180, rlon= pi()*($lon2$-$lon1$)/180\
| eval a = sin(rlat/2) * sin(rlat/2) + cos(rlat1) * cos(rlat2) * sin(rlon/2) * sin(rlon/2) \
| eval c = 2 * atan2(sqrt(a), sqrt(1-a)) \
| eval distance = 6371 * c | fields - a c r*
iseval = 0
it can then be used in the SPL like this: | distance(lat1,lon1,lat2,lon2) (sorry not able to add the tick-thingy around the macro).
Hope this helps ...
cheers, MuS
... View more