niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » MySQL
Finding a point inside a polygon
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Mark Maunder
*nix forums beginner


Joined: 20 Jul 2006
Posts: 3

PostPosted: Thu Jul 20, 2006 11:10 pm    Post subject: Finding a point inside a polygon Reply with 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=gcdmg-mysql@m.gmane.org
Back to top
Mark Maunder
*nix forums beginner


Joined: 20 Jul 2006
Posts: 3

PostPosted: Fri Jul 21, 2006 6:57 am    Post subject: Re: Finding a point inside a polygon Reply with quote

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

PostPosted: Fri Jul 21, 2006 7:03 am    Post subject: Re: Finding a point inside a polygon Reply with 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


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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Sun Nov 23, 2008 2:17 pm | All times are GMT
navigation Forum index » Databases » MySQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts problems using oddmuse with mod_perl2 inside apache2.2 pe... Fergus McMenemie Perl 0 Fri Jul 21, 2006 9:48 am
No new posts Does stream I/O support "%a" floating-point format? John Friedland C++ 3 Fri Jul 21, 2006 9:26 am
No new posts determine pointer to point to array or single item during... yancheng.cheok@gmail.com C++ 5 Fri Jul 21, 2006 1:17 am
No new posts effects of aquiring exclusive lock on subsequent reads in... Nikita Tovstoles MySQL 0 Thu Jul 20, 2006 11:01 pm
No new posts new installation not finding large memory Miles Fidelman Debian 8 Thu Jul 20, 2006 9:00 pm

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
[ Time: 0.1347s ][ Queries: 16 (0.0550s) ][ GZIP on - Debug on ]