Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>MySQL as of v5.1 only supports operations on the <a href="http://dev.mysql.com/doc/refman/5.1/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr" rel="noreferrer">minimum bounding rectangles (MBR)</a>. While there is a "<a href="http://dev.mysql.com/doc/refman/5.1/en/functions-for-testing-spatial-relations-between-geometric-objects.html#function_contains" rel="noreferrer">Contains</a>" function which would do what you need, it is not fully implemented and falls back to using <a href="http://dev.mysql.com/doc/refman/5.1/en/functions-for-testing-spatial-relations-between-geometric-objects.html#function_mbrcontains" rel="noreferrer">MBRContains</a></p> <p>From the <a href="http://dev.mysql.com/doc/refman/5.1/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries" rel="noreferrer">relevant manual page</a></p> <blockquote> <p>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. This includes functions in the following list other than Distance() and Related().</p> <p>These functions may be implemented in future releases with full support for spatial analysis, not just MBR-based support.</p> </blockquote> <p>What you could do is let MySQL give you an approximate result based on MBR, and then post process it to perform a more accurate test. Alternatively, switch to <a href="http://postgis.refractions.net/" rel="noreferrer">PostGIS</a>!</p> <p><strong>(Update May 2012 - thanks Mike Toews)</strong></p> <p>MySQL 5.6.1+ offers <a href="http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html#function_st-contains" rel="noreferrer">functions which use object shapes</a> rather than MBR</p> <blockquote> <p>MySQL originally implemented these functions such that they used object bounding rectangles and returned the same result as the corresponding MBR-based functions. As of MySQL 5.6.1, corresponding versions are available that use precise object shapes. These versions are named with an ST_ prefix. For example, Contains() uses object bounding rectangles, whereas ST_Contains() uses object shapes.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload