Rechercher dans le manuel MySQL
12.16.3 Functions That Create Geometry Values from WKT Values
These functions take as arguments a Well-Known Text (WKT) representation and, optionally, a spatial reference system identifier (SRID). They return the corresponding geometry. For a description of WKT format, see Well-Known Text (WKT) Format.
Functions in this section detect arguments in either Cartesian or geographic spatial reference systems (SRSs), and return results appropriate to the SRS.
ST_GeomFromText()
accepts a WKT
value of any geometry type as its first argument. Other functions
provide type-specific construction functions for construction of
geometry values of each geometry type.
Functions such as
ST_MPointFromText()
and
ST_GeomFromText()
that accept
WKT-format representations of MultiPoint
values
permit individual points within values to be surrounded by
parentheses. For example, both of the following function calls are
valid:
- ST_MPointFromText('MULTIPOINT (1 1, 2 2, 3 3)')
- ST_MPointFromText('MULTIPOINT ((1 1), (2 2), (3 3))')
Functions such as ST_GeomFromText()
that accept WKT geometry collection arguments understand both
OpenGIS 'GEOMETRYCOLLECTION EMPTY'
standard
syntax and MySQL 'GEOMETRYCOLLECTION()'
nonstandard syntax. Functions such as
ST_AsWKT()
that produce WKT values produce 'GEOMETRYCOLLECTION
EMPTY'
standard syntax:
- +--------------------------+--------------------------+
- | ST_AsWKT(@s1) | ST_AsWKT(@s2) |
- +--------------------------+--------------------------+
- +--------------------------+--------------------------+
Unless otherwise specified, functions in this section handle their arguments as follows:
If any geometry argument is
NULL
or is not a syntactically well-formed geometry, or if the SRID argument isNULL
, the return value isNULL
.By default, geographic coordinates (latitude, longitude) are interpreted as in the order specified by the spatial reference system of geometry arguments. An optional
options
argument may be given to override the default axis order.options
consists of a list of comma-separated
. The onlypermittedkey
=value
key
value isaxis-order
, with permitted values oflat-long
,long-lat
andsrid-defined
(the default).If the
options
argument isNULL
, the return value isNULL
. If theoptions
argument is invalid, an error occurs to indicate why.If an SRID argument refers to an undefined spatial reference system (SRS), an
ER_SRS_NOT_FOUND
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.
These functions are available for creating geometries from WKT values:
ST_GeomCollFromText(
,wkt
[,srid
[,options
]])ST_GeometryCollectionFromText(
,wkt
[,srid
[,options
]])ST_GeomCollFromTxt(
wkt
[,srid
[,options
]])Constructs a
GeometryCollection
value using its WKT representation and SRID.These functions handle their arguments as described in the introduction to this section.
- +--------------------------------------------+
- | ST_AsText(ST_GeomCollFromText(@g)) |
- +--------------------------------------------+
- +--------------------------------------------+
ST_GeomFromText(
,wkt
[,srid
[,options
]])ST_GeometryFromText(
wkt
[,srid
[,options
]])Constructs a geometry value of any type using its WKT representation and SRID.
These functions handle their arguments as described in the introduction to this section.
ST_LineFromText(
,wkt
[,srid
[,options
]])ST_LineStringFromText(
wkt
[,srid
[,options
]])Constructs a
LineString
value using its WKT representation and SRID.These functions handle their arguments as described in the introduction to this section.
ST_MLineFromText(
,wkt
[,srid
[,options
]])ST_MultiLineStringFromText(
wkt
[,srid
[,options
]])Constructs a
MultiLineString
value using its WKT representation and SRID.These functions handle their arguments as described in the introduction to this section.
ST_MPointFromText(
,wkt
[,srid
[,options
]])ST_MultiPointFromText(
wkt
[,srid
[,options
]])Constructs a
MultiPoint
value using its WKT representation and SRID.These functions handle their arguments as described in the introduction to this section.
ST_MPolyFromText(
,wkt
[,srid
[,options
]])ST_MultiPolygonFromText(
wkt
[,srid
[,options
]])Constructs a
MultiPolygon
value using its WKT representation and SRID.These functions handle their arguments as described in the introduction to this section.
ST_PointFromText(
wkt
[,srid
[,options
]])Constructs a
Point
value using its WKT representation and SRID.ST_PointFromText()
handles its arguments as described in the introduction to this section.ST_PolyFromText(
,wkt
[,srid
[,options
]])ST_PolygonFromText(
wkt
[,srid
[,options
]])Constructs a
Polygon
value using its WKT representation and SRID.These functions handle their arguments as described in the introduction to this section.
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-gis-wkt-functions.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.