MySQL Forums
Forum List  »  GIS

Unable to get spatial examples working
Posted by: Michael Gray
Date: March 22, 2006 12:23AM

Hi - I'm having difficulties getting spatial relationships to work at all in MySQL.

I started off with trying more advanced tables etc... but I seem to have some configuration difficulty, since I'm guessing the MBRContains does work for you all.

So, I went all the way back to the basics out of the CHM manual (note, 5.0 seems to be corrupt and no searchable, so am referencing 4.1 more).

I've created the database (I thought as MyISAM, but not sure how to check at this hour), and have taking the following example right out of the pages (since I figured that I was certainly doing something wrong on my own). Well, I can't get this to work either:

SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
SET @g2 = GeomFromText('Point(1 1)');
SELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);

SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
SET @g2 = GeomFromText('Polygon((0 0,0 5,5 5,5 0,0 0))');
SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);

I'm also still adapting to MySQL interface as well -- if I just highlight the query lines and execute, I get "Query returned no resultset". If I open a new resultset window in MySQL Query Browser and execute (apparently the whole window), I get two columns back with NULL in both. [I shouldn't need a new query window for each set of actions, should I???]

Have you run across this? I think it is a combination of my naivete within this dbms and the fact that it seems the spatial relationships aren't as straight forward as they should be...


WinXPsp2, MySQL Query Browser 1.1.20, MySQL 5.0 - all installed with defaults.

Options: ReplyQuote

Written By
Unable to get spatial examples working
March 22, 2006 12:23AM

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.