vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Does anybody actually use the MySQL spatial extensions? Suppose I have a database like: CREATE TABLE gasstations ( brand VARCHAR(32) NOT NULL, location POINT NOT NULL, SPATIAL INDEX (location) ) ENGINE=MyISAM; That works. So I load up a few rows, which works. Then I try a simple query like this: SELECT brand, AsText(location) FROM gasstations ORDER BY Distance(location, GeomFromText('POINT(50 20)')); No good: "FUNCTION test.Distance does not exist. (1305)". I could see some of the elaborate functions, like the ones that compute the intersection of two arbitrary polygons, not being implemented. But "Distance"? Without that, you can't do much. That was bug #5039 back in 2004, in MySQL 4.1.4 beta. Is it still broken? There's a statement at http://dev.mysql.com/doc/refman/5.0/...eometries.html which indicates that the implementation of these functions is dumb and works on bounding rectangles, not polygonal geometry. But for points, that's no problem. In fact, though, even less is implemented than the manual suggests. See http://forge.mysql.com/worklog/task.php?id=2377 which is the dirty-laundry list for the geometry extensions. That's undated; I'm not sure to what it applies. I was going to ask if the query optimizer knew how to optimize something like SELECT brand, AsText(location) FROM gasstations ORDER BY Distance(location, GeomFromText('POINT(50 20)')) LIMIT 10; but it looks like that's a long way off, even though it's about as basic as a GIS query gets. John Nagle |
| ||||
| John Nagle wrote: > John Nagle wrote: >> Does anybody actually use the MySQL spatial extensions? > > Deafening silence. I'm starting to get the feeling that the answer is > "No". > > John Nagle and you would be very incorrect... (not me.. but there are alot of places that do...) |
| Thread Tools | |
| Display Modes | |
|
|