GeoObject -> getEarthRadius


GeoObject -> getEarthRadius

Returns the radius of the earth in the given unit it is based on the constant GEO_EARTH_RADIUS.

float getEarthRadius([string unit])

Parameters

[string $unit] : default: GEO_UNIT
The unit could be one of these:
"km" (Kilometers), "miles" (miles), "sm" (seamiles)

Example

To access this function you can create an empty GeoObject.

$dummy = new GeoObject();
print $dummy->getEarthRadius()." ".GEO_UNIT;

6371.0 km