Created
September 29, 2012 10:35
-
-
Save rob-murray/3803657 to your computer and use it in GitHub Desktop.
Simple SQL script to load os locator data into MySQL
This file contains hidden or 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
| delimiter $$ | |
| DROP TABLE IF EXISTS OSDATA.locator; | |
| CREATE TABLE OSDATA.locator ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `name` varchar(255) NOT NULL, | |
| `classification` varchar(45) NOT NULL, | |
| `centx` int(11) NOT NULL DEFAULT '0', | |
| `centy` int(11) NOT NULL DEFAULT '0', | |
| `minx` int(11) NOT NULL DEFAULT '0', | |
| `maxx` int(11) NOT NULL DEFAULT '0', | |
| `miny` int(11) NOT NULL DEFAULT '0', | |
| `maxy` int(11) NOT NULL DEFAULT '0', | |
| `settlement` varchar(255) NOT NULL, | |
| `locality` varchar(255) NOT NULL, | |
| `cou_unit` varchar(255) NOT NULL, | |
| `local_auth` varchar(255) NOT NULL, | |
| `tile_10k` varchar(45) DEFAULT NULL, | |
| `tile_25k` varchar(45) DEFAULT NULL, | |
| `source` varchar(45) DEFAULT NULL, | |
| PRIMARY KEY (`id`), | |
| KEY `road_name_classification_indx` (`name`,`classification`), | |
| FULLTEXT KEY `road_name_fulltext` (`name`) | |
| ) ENGINE=MyISAM DEFAULT CHARSET=utf8$$ | |
| LOAD DATA LOCAL INFILE "/tmp/os_locator.txt" | |
| INTO TABLE OSDATA.locator FIELDS TERMINATED BY ':' | |
| ESCAPED BY '"' | |
| LINES TERMINATED BY '\r\n' | |
| (name,classification,centx,centy,minx,maxx,miny,maxy,settlement,locality,cou_unit,local_auth,tile_10k,tile_25k,source); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment