Pre-General Availability Draft: 2017-07-17
These functions take as arguments a
BLOB containing a Well-Known Binary
(WKB) representation and, optionally, a spatial reference system
identifier (SRID). They return the corresponding geometry.
The functions interpret geographic coordinates (latitude,
longitude) as in the order specified by the spatial reference
system. An optional options argument
may be given to override the default axis order.
ST_GeomFromWKB() accepts a WKB
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.
Prior to MySQL 8.0, these functions also accepted geometry objects as returned by the functions in Section 12.15.5, “MySQL-Specific Functions That Create Geometry Values”. Geometry arguments are no longer permitted and produce an error. To migrate calls from using geometry arguments to using WKB arguments, follow these guidelines:
Rewrite constructs such as
ST_GeomFromWKB(Point(0, 0))asPoint(0, 0).Rewrite constructs such as
ST_GeomFromWKB(Point(0, 0), 4326)asST_SRID(Point(0, 0), 4326)orST_GeomFromWKB(ST_AsWKB(Point(0, 0)), 4326).
For a description of WKB format, see Well-Known Binary (WKB) Format.
ST_GeomCollFromWKB(,wkb[,srid[,options]])ST_GeometryCollectionFromWKB(wkb[,srid[,options]])Constructs a
GeometryCollectionvalue using its WKB representation and SRID.The result is
NULLif the WKB or SRID argument isNULL.The functions interpret geographic coordinates (latitude, longitude) as in the order specified by the spatial reference system. An optional
optionsargument may be given to override the default axis order.The result is
NULLif theoptionsargument isNULL. If theoptionsargument is invalid, an error occurs to indicate why.ST_GeomFromWKB(,wkb[,srid[,options]])ST_GeometryFromWKB(wkb[,srid[,options]])Constructs a geometry value of any type using its WKB representation and SRID.
The result is
NULLif the WKB or SRID argument isNULL.The functions interpret geographic coordinates (latitude, longitude) as in the order specified by the spatial reference system. An optional
optionsargument may be given to override the default axis order.The result is
NULLif theoptionsargument isNULL. If theoptionsargument is invalid, an error occurs to indicate why.ST_LineFromWKB(,wkb[,srid[,options]])ST_LineStringFromWKB(wkb[,srid[,options]])Constructs a
LineStringvalue using its WKB representation and SRID.The result is
NULLif the WKB or SRID argument isNULL.The functions interpret geographic coordinates (latitude, longitude) as in the order specified by the spatial reference system. An optional
optionsargument may be given to override the default axis order.The result is
NULLif theoptionsargument isNULL. If theoptionsargument is invalid, an error occurs to indicate why.ST_MLineFromWKB(,wkb[,srid[,options]])ST_MultiLineStringFromWKB(wkb[,srid[,options]])Constructs a
MultiLineStringvalue using its WKB representation and SRID.The result is
NULLif the WKB or SRID argument isNULL.The functions interpret geographic coordinates (latitude, longitude) as in the order specified by the spatial reference system. An optional
optionsargument may be given to override the default axis order.The result is
NULLif theoptionsargument isNULL. If theoptionsargument is invalid, an error occurs to indicate why.ST_MPointFromWKB(,wkb[,srid[,options]])ST_MultiPointFromWKB(wkb[,srid[,options]])Constructs a
MultiPointvalue using its WKB representation and SRID.The result is
NULLif the WKB or SRID argument isNULL.The functions interpret geographic coordinates (latitude, longitude) as in the order specified by the spatial reference system. An optional
optionsargument may be given to override the default axis order.The result is
NULLif theoptionsargument isNULL. If theoptionsargument is invalid, an error occurs to indicate why.ST_MPolyFromWKB(,wkb[,srid[,options]])ST_MultiPolygonFromWKB(wkb[,srid[,options]])Constructs a
MultiPolygonvalue using its WKB representation and SRID.The result is
NULLif the WKB or SRID argument isNULL.The functions interpret geographic coordinates (latitude, longitude) as in the order specified by the spatial reference system. An optional
optionsargument may be given to override the default axis order.The result is
NULLif theoptionsargument isNULL. If theoptionsargument is invalid, an error occurs to indicate why.ST_PointFromWKB(wkb[,srid[,options]])Constructs a
Pointvalue using its WKB representation and SRID.The result is
NULLif the WKB or SRID argument isNULL.The functions interpret geographic coordinates (latitude, longitude) as in the order specified by the spatial reference system. An optional
optionsargument may be given to override the default axis order.The result is
NULLif theoptionsargument isNULL. If theoptionsargument is invalid, an error occurs to indicate why.ST_PolyFromWKB(,wkb[,srid[,options]])ST_PolygonFromWKB(wkb[,srid[,options]])Constructs a
Polygonvalue using its WKB representation and SRID.The result is
NULLif the WKB or SRID argument isNULL.The functions interpret geographic coordinates (latitude, longitude) as in the order specified by the spatial reference system. An optional
optionsargument may be given to override the default axis order.The result is
NULLif theoptionsargument isNULL. If theoptionsargument is invalid, an error occurs to indicate why.