Rechercher dans le manuel MySQL
12.16.9.2 Spatial Relation Functions That Use Minimum Bounding Rectangles
MySQL provides several MySQL-specific functions that test the
relationship between minimum bounding rectangles (MBRs) of two
geometries g1
and g2
. The
return values 1 and 0 indicate true and false, respectively.
The bounding box of a point is interpreted as a point that is both boundary and interior.
The bounding box of a straight horizontal or vertical line is interpreted as a line where the interior of the line is also boundary. The endpoints are boundary points.
If any of the parameters are geometry collections, the interior, boundary, and exterior of those parameters are those of the union of all elements in the collection.
Functions in this section detect arguments in either Cartesian or geographic spatial reference systems (SRSs), and return results appropriate to the SRS.
Unless otherwise specified, functions in this section handle their arguments as follows:
If any argument is
NULL
or an empty geometry, the return value isNULL
.If any geometry argument is not a syntactically well-formed geometry, an
ER_GIS_INVALID_DATA
error occurs.If any geometry argument refers to an undefined spatial reference system (SRS), an
ER_SRS_NOT_FOUND
error occurs.For functions that take multiple geometry arguments, if those arguments do not have the same SRID, an
ER_GIS_DIFFERENT_SRIDS
error occurs.If any argument is geometrically invalid, either the result is true or false (it is undefined which), or an error occurs.
For geographic SRS geometry arguments, if any argument has a longitude or latitude that is out of range, an error occurs:
If a longitude value is not in the range (−180, 180], an
ER_LONGITUDE_OUT_OF_RANGE
error occurs.If a latitude value is not in the range [−90, 90], an
ER_LATITUDE_OUT_OF_RANGE
error occurs.
Ranges shown are in degrees. If an SRS uses another unit, the range uses the corresponding values in its unit. The exact range limits deviate slightly due to floating-point arithmetic.
Otherwise, the return value is non-
NULL
.
These MBR functions are available for testing geometry relationships:
Returns 1 or 0 to indicate whether the minimum bounding rectangle of
g1
contains the minimum bounding rectangle ofg2
. This tests the opposite relationship asMBRWithin()
.MBRContains()
handles its arguments as described in the introduction to this section.- +----------------------+--------------------+
- +----------------------+--------------------+
- | 1 | 1 |
- +----------------------+--------------------+
Returns 1 or 0 to indicate whether the minimum bounding rectangle of
g1
is covered by the minimum bounding rectangle ofg2
. This tests the opposite relationship asMBRCovers()
.MBRCoveredBy()
handles its arguments as described in the introduction to this section.- +--------------------+-----------------------+
- | MBRCovers(@g1,@g2) | MBRCoveredby(@g1,@g2) |
- +--------------------+-----------------------+
- | 1 | 0 |
- +--------------------+-----------------------+
- +--------------------+-----------------------+
- | MBRCovers(@g2,@g1) | MBRCoveredby(@g2,@g1) |
- +--------------------+-----------------------+
- | 0 | 1 |
- +--------------------+-----------------------+
Returns 1 or 0 to indicate whether the minimum bounding rectangle of
g1
covers the minimum bounding rectangle ofg2
. This tests the opposite relationship asMBRCoveredBy()
. See the description ofMBRCoveredBy()
for examples.MBRCovers()
handles its arguments as described in the introduction to this section.Returns 1 or 0 to indicate whether the minimum bounding rectangles of the two geometries
g1
andg2
are disjoint (do not intersect).MBRDisjoint()
handles its arguments as described in the introduction to this section.Returns 1 or 0 to indicate whether the minimum bounding rectangles of the two geometries
g1
andg2
are the same.MBREquals()
handles its arguments as described in the introduction to this section, except that it does not returnNULL
for empty geometry arguments.Returns 1 or 0 to indicate whether the minimum bounding rectangles of the two geometries
g1
andg2
intersect.MBRIntersects()
handles its arguments as described in the introduction to this section.Two geometries spatially overlap if they intersect and their intersection results in a geometry of the same dimension but not equal to either of the given geometries.
This function returns 1 or 0 to indicate whether the minimum bounding rectangles of the two geometries
g1
andg2
overlap.MBROverlaps()
handles its arguments as described in the introduction to this section.Two geometries spatially touch if their interiors do not intersect, but the boundary of one of the geometries intersects either the boundary or the interior of the other.
This function returns 1 or 0 to indicate whether the minimum bounding rectangles of the two geometries
g1
andg2
touch.MBRTouches()
handles its arguments as described in the introduction to this section.Returns 1 or 0 to indicate whether the minimum bounding rectangle of
g1
is within the minimum bounding rectangle ofg2
. This tests the opposite relationship asMBRContains()
.MBRWithin()
handles its arguments as described in the introduction to this section.- +--------------------+--------------------+
- +--------------------+--------------------+
- | 1 | 0 |
- +--------------------+--------------------+
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-spatial-relation-functions-mbr.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.