Created
August 24, 2015 14:02
-
-
Save greut/6ace07c98659bb313318 to your computer and use it in GitHub Desktop.
Inserting Neuchâtel into a spatial index.
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
| CREATE TABLE cities ( | |
| id INT AUTO_INCREMENT, | |
| code INT NOT NULL, | |
| name VARCHAR(127) NOT NULL, | |
| kanton CHAR(2) NOt NULL, | |
| g GEOMETRY NOT NULL, | |
| PRIMARY KEY (id), | |
| UNIQUE KEY (code), | |
| UNIQUE KEY (name), | |
| SPATIAL INDEX (g) | |
| ) ENGINE=MyISAM; | |
| INSERT INTO cities (code, name, kanton, g) VALUES ( | |
| 2000, | |
| "Neuchâtel", | |
| "NE", | |
| POINT(46.9895828, 6.9292641) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment