MySQL Forums
Forum List  »  GIS

Point in Polygon Problem
Posted by: Tom Bernhardt
Date: July 16, 2008 09:30AM

Two questions:

1) Does anyone have any insight into the release path of the correctly implemented GIS functionality (meaning not using MBR's for calculations)? How much is it being worked and is it going to be in the GA Release for 5.1 or 6.0?

2) I'm trying to evaluate v5.1.23 GIS functionality and I'm struggling getting it to work properly. If you can look at the following CREATE TABLE and query to see where I'm going wrong I'd appreciate it.

CREATE TABLE PolygonTest(
files_idx INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
bounds POLYGON NOT NULL,
SPATIAL INDEX(bounds)
)ENGINE=myisam;

OR

CREATE TABLE PolygonTest(
files_idx INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
bounds POLYGON NOT NULL
);

I've tried creating the table both ways with no success....

Snippet of the Insert Statement...
INSERT INTO polygontest VALUES
(DEFAULT, GeomFromText('POLYGON((38.286911 -77.453751, 38.295609 -77.445000, 38.295746 -77.445541, 38.286938 -77.454086, 38.286911 -77.453751))')),
.....

I'll insert ~1500 rows of data and it works ok although with the Query Browser v. 1.2.12 when I query displaying the polygon AsText it shows it as being a BLOB.

Finally, the query I'm executing...

SELECT AsText(bounds)
FROM file_bounds
WHERE Contains(GeomFromText('POINT((38.75020 -77.21683))'), file_bounds.bounds) = 1;

I'm expecting about 23 rows to be returned from the query. It works using PostGres but I can't get MySQL to return any results.

Any help would be appreciated.

Tom Bernhardt

Options: ReplyQuote


Subject
Views
Written By
Posted
Point in Polygon Problem
5850
July 16, 2008 09:30AM


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.