|
|
|
|
|
|
| Author |
Message |
Mark Maunder *nix forums beginner
Joined: 20 Jul 2006
Posts: 3
|
Posted: Thu Jul 20, 2006 11:10 pm Post 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/mysql?unsub=gcdmg-mysql@m.gmane.org |
|
| Back to top |
|
 |
Mark Maunder *nix forums beginner
Joined: 20 Jul 2006
Posts: 3
|
Posted: Fri Jul 21, 2006 6:57 am Post subject:
Re: Finding a point inside a polygon
|
|
|
Thanks, but according to the documentation the Contains() function is
the same as the MBRContains() function which only tests if the point
is inside the minimum bounding rectangle of the polygon, not the
actual polygon.
See the following:
http://dev.mysql.com/doc/refman/5.0/en/functions-that-test-spatial-relationships-between-geometries.html
From the manual:
"Currently, MySQL does not implement these functions according to the
specification. Those that are implemented return the same result as
the corresponding MBR-based functions."
On 7/21/06, ViSolve DB Team <mysql_support@visolve.com> wrote:
| Quote: | 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" <mmaunder@gmail.com
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/mysql?unsub=mysql_support@visolve.com
|
--
Mark Maunder <mmaunder@gmail.com>
http://www.markmaunder.com/
+1-206-6978723
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org |
|
| Back to top |
|
 |
Visolve DB Team *nix forums beginner
Joined: 21 Jul 2006
Posts: 3
|
Posted: Fri Jul 21, 2006 7:03 am Post subject:
Re: Finding a point inside a polygon
|
|
|
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" <mmaunder@gmail.com>
To: <mysql@lists.mysql.com>
Sent: Friday, July 21, 2006 4:40 AM
Subject: Finding a point inside a polygon
| Quote: | 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/mysql?unsub=mysql_support@visolve.com
|
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sun Nov 23, 2008 2:17 pm | All times are GMT
|
|
Loans | Home Loan | Credit Cards UK | Credit Cards | Personal Loans
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|