Hello Mark,

You can locate a point, whether inside or outside a polygon area using the query below:

SELECT contains(geomfromtext(@poly),geomfromtext(@p));

where @poly,@p are variables.
Eg:             set @p='Point(3 2)';
set @poly= 'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1)) ';

If the return value of the select statement is
           0  -> Outside the polygon
           1  -> Inside the polygon

Thanks,
ViSolve MySQL Support Team.
----- Original Message ----- From: "Mark Maunder" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Friday, July 21, 2006 4:40 AM
Subject: Finding a point inside a polygon


I'd like to test whether a point is truly inside a polygon, not just
insude the minimum bounding rectangle. Is there a way to do this in
MySQL with the spatial extensions? I love mysql but I'm forced to
consider migrating to postgresql (ugh!) because it has built in
support for testing spatial relationships between polygons and points.

Thanks.

Mark.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to