-
Notifications
You must be signed in to change notification settings - Fork 0
Geo queries
saerdnaer edited this page Sep 14, 2010
·
4 revisions
We are using some geo spatial extensions of our MySQL Database.
Note: the gis extension is actived in MySQL by default, but our version of phpMyAdmin didn’t show any geo data types.
(from http://dev.mysql.com/tech-resources/articles/4.1/gis-with-mysql.html)
(returns true or flase)
- http://dev.mysql.com/doc/refman/5.0/en/functions-that-test-spatial-relationships-between-geometries.html
Example:
SELECT p.user_name AS player, o.user_name AS opponent, Intersects(p.line, o.line) FROM lines2 p, lines2 o WHERE p.game_id = 1 AND p.game_id = o.game_id AND p.user_name = 'Kojote' AND o.user_name != p.user_name
- http://dev.mysql.com/doc/refman/5.0/en/functions-that-create-new-geometries-from-existing-ones.html#spatial-operators
Example:
SELECT p.user_name AS player, o.user_name AS opponent, Intersection(p.line, o.line) FROM lines2 p, lines2 o WHERE p.game_id = 1 AND p.game_id = o.game_id AND p.user_name = 'Kojote' AND o.user_name != p.user_name
Note: Doesn’t work with our two mysql servers, reason unknown. error: #1305 – FUNCTION gtug_muc_campout.Intersection does not exist Maybe a MySQL Bug
- http://dev.mysql.com/doc/refman/5.1-olh/de/creating-spatial-values.html
- http://mapki.com/wiki/Spatial_Data_in_MySQL
- List of databases with geospatital extensions