Revision 564 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/lib/geopy/distance.py

View differences:

distance.py
8 8
`geopy.distance.distance`.
9 9

  
10 10
Great-circle distance (:class:`.great_circle`) uses a spherical model of
11
the earth, using the average great-circle radius of 6372.795 kilometers,
12
resulting in an error of up to about 0.5%. The radius value is stored in
13
:const:`distance.EARTH_RADIUS`, so it can be customized
14
(it should always be in kilometers, however).
11
the earth, using the mean earth radius as defined by the International
12
Union of Geodesy and Geophysics, (2*a + b)/3 = 6371.0087714150598
13
kilometers approx 6371.009 km (for WGS-84), resulting in an error of up
14
to about 0.5%. The radius value is stored in
15
:const:`distance.EARTH_RADIUS`, so it can be customized (it should
16
always be in kilometers, however).
15 17

  
16 18
Vincenty distance (:class:`.vincenty`) uses a more accurate ellipsoidal model
17 19
of the earth. This is the default distance formula, and is thus aliased as
......
77 79
from geopy.point import Point
78 80
from geopy.compat import string_compare
79 81

  
80
# Average great-circle radius in kilometers, from Wikipedia.
81
# Using a sphere with this radius results in an error of up to about 0.5%.
82
EARTH_RADIUS = 6372.795
82
# IUGG mean earth radius in kilometers, from
83
# https://en.wikipedia.org/wiki/Earth_radius#Mean_radius.  Using a
84
# sphere with this radius results in an error of up to about 0.5%.
85
EARTH_RADIUS = 6371.009
83 86

  
84 87
# From http://www.movable-type.co.uk/scripts/LatLongVincenty.html:
85 88
#   The most accurate and widely used globally-applicable model for the earth

Also available in: Unified diff