MySQL Forums
Forum List  »  GIS

Re: Unable to get spatial examples working
Posted by: Michael Gray
Date: March 22, 2006 04:29PM

Okay - Have figured out a little more -- apparently it is a problem with my use of the MySQL Query Browser -- it is treating each line independently of each other instead of as a single active session. Thus, the NULLs are caused by the 3rd line NOT knowing what the variables are! Argh.

I tested it by opening a direct cmd interface into MySQL -->

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot -ppassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 25 to server version: 5.0.19-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SET @g1 := GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
Query OK, 0 rows affected (0.00 sec)

mysql> SET @g2 := GeomFromText('Polygon((0 0,0 5,5 5,5 0,0 0))');
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);
+--------------------+--------------------+
| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |
+--------------------+--------------------+
| 1 | 0 |
+--------------------+--------------------+
1 row in set (0.00 sec)



Soo.... the question now remaining, is what query environment (preferably freeware) are you using to develop with variables and spatial gis in? I don't need much of a gui (number of years in SQLServer/SQL Query Analyzer/and distant past a bit of Oracle).

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Unable to get spatial examples working
3076
March 22, 2006 04:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.