MySQL Forums
Forum List  »  GIS

Point Within Multipolygon
Posted by: Jure Zakrajsek
Date: January 15, 2013 04:29AM

Hello,

Im running mysql on synology NAS server version 5.1.49 - Source distribution that was installed on the system.

I have a database containing a multipolygon and i want to query if selected coordinates are within this multypoligon in a specific range of dates.
I have found the GISWithin function (http://forums.mysql.com/read.php?23,286574,286574#msg-286574) which works correctly, but it is working a lot slower than the build in Within function, since i guess it does not use the spatial index on my GIS field. Below is the explain result for my query. Im missing a possible_key field which is a spatial index for the multipolygon field.

EXPLAIN SELECT * FROM arhiv WHERE GISWithin(GEOMFROMTEXT( 'Point(120 10)' ) , field) AND obsdate BETWEEN '2010-01-01' AND '2013-01-01' ORDER BY obsdate ASC
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE arhiv range obsdate obsdate 8 NULL 180659 Using where


The build in WITHIN function seems to give false results, it looks like it uses MBR calculations.

Is there a way to test if the GIS functions in this distribution work in a correct way and not with MBR calculations.
If my mysql does not have the corrected within function is there any way to implement it into my distribution? Im very limited on building it from source.

Thank you for any help
Best regards
Jure

Options: ReplyQuote


Subject
Views
Written By
Posted
Point Within Multipolygon
5888
January 15, 2013 04:29AM
3105
January 28, 2013 05:43PM
2465
March 21, 2013 09:03AM


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.