Pergunta

Does anyone ever use MySQL spatial buffer function successfully? I've read the documentation here: http://dev.mysql.com/doc/refman/5.0/en/functions-that-create-new-geometries-from-existing-ones.html#function_buffer

As stated in the documentation, buffer function has 2 parameters. The first one is geometry typed, the second one is distance.

I've try to make a geometry variable

mysql> set @g1 = geomfromtext('POINT(1 1)');
Query OK, 0 rows affected (0.00 sec)

Then, to ensure that my variable is correctly set, I perform a query. If the variable not correctly set, such a query will return NULL. In this case, it is confirmed that my variable is correctly set

mysql> select astext(@g1);
+-------------+
| astext(@g1) |
+-------------+
| POINT(1 1)  |
+-------------+
1 row in set (0.00 sec)

I run a query to select a buffer as stated in documentation

mysql> select astext(buffer(@g1, 5));
ERROR 1305 (42000): FUNCTION module_devel.buffer does not exist

Do I miss something here?

EDIT Sorry guys, I think I miss this:

12.17.5.3.2. Spatial Operators

OpenGIS proposes a number of other functions that can produce geometries. They are designed to implement spatial operators. These functions are not implemented in MySQL.

Foi útil?

Solução

This is related to this bug report maybe. Which MySQL server are you using? Maybe you should upgrade to 5.6.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top