Created
June 28, 2014 16:03
-
-
Save bordeux/7a9374a187dd6d10bf11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 4.1.6 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost | |
-- Generation Time: Jun 28, 2014 at 06:05 PM | |
-- Server version: 5.5.34-0ubuntu0.13.04.1 | |
-- PHP Version: 5.5.13-2+deb.sury.org~precise+1 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | |
SET time_zone = "+00:00"; | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8 */; | |
-- | |
-- Database: `mygps` | |
-- | |
DELIMITER $$ | |
-- | |
-- Functions | |
-- | |
CREATE DEFINER=`root`@`localhost` FUNCTION `distance_between`(from_lat DECIMAL(6, 3), from_lng DECIMAL(6, 3), to_lat DECIMAL(6, 3), to_lng DECIMAL(6, 3)) RETURNS decimal(11,3) | |
RETURN 6371 * 2 * ATAN2(SQRT(POW(SIN(RADIANS(to_lat - from_lat)/2), 2) + POW(SIN(RADIANS(to_lng - from_lng)/2), 2) * COS(RADIANS(from_lat)) * COS(RADIANS(to_lat))), SQRT(1 - POW(SIN(RADIANS(to_lat - from_lat)/2), 2) + POW(SIN(RADIANS(to_lng - from_lng)/2), 2) * COS(RADIANS(from_lat)) * COS(RADIANS(to_lat))))$$ | |
DELIMITER ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `gps_links` | |
-- | |
CREATE TABLE IF NOT EXISTS `gps_links` ( | |
`link_id` varchar(30) NOT NULL, | |
`link_from` datetime NOT NULL, | |
`link_to` datetime NOT NULL, | |
PRIMARY KEY (`link_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `gps_locations` | |
-- | |
CREATE TABLE IF NOT EXISTS `gps_locations` ( | |
`gps_id` int(11) NOT NULL AUTO_INCREMENT, | |
`gps_date` datetime NOT NULL, | |
`gps_point` point NOT NULL, | |
`gps_speed` float NOT NULL, | |
`gps_course` float NOT NULL, | |
`gps_millage` int(11) NOT NULL, | |
`gps_data` blob NOT NULL, | |
PRIMARY KEY (`gps_id`), | |
KEY `gps_date` (`gps_date`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=147428 ; | |
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | |
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | |
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment