public static function encodeCoordinates($coords)
    {
        static $encoder;

        if ($encoder == null) {
            $encoder = new self();
        }

        $points = [];
        foreach ($coords as $coord) {
            $points[] = explode(',', $coord);
        }

        return "enc:{$encoder->encode($points)}";
    }