public static function distance(Point $p1, Point $p2, $provider = "haversine")
    {
        switch ($provider){
            case "haversine":
                return self::haversineGreatCircleDistance($p1, $p2);

            case "vincenty":
                return self::vincentyGreatCircleDistance($p1, $p2);

            default:
                throw new GeoSpatialException('Great circle distance provider not found, providers available: ' . implode(", ", self::$greatCircleproviders));
        }
    }