相关文章推荐
慷慨的烈马  ·  C++ ...·  10 月前    · 
害羞的篮球  ·  ChatYuan首页、文档和下载 - ...·  2 年前    · 
瘦瘦的烤红薯  ·  jasypt对Spring ...·  2 年前    · 
温文尔雅的橡皮擦  ·  有哪些比较好的爬虫技术交流论坛或群? - 知乎·  2 年前    · 
大气的伏特加  ·  「python大小写」相关问答|文档|产品| ...·  2 年前    · 
Code  ›  MySQL :: MySQL 8.4 Reference Manual :: 14.16.3 Functions That Create Geometry Values from WKT Values
https://dev.mysql.com/doc/refman/8.4/en/gis-wkt-functions.html
乖乖的莲藕
1 年前
Argument Handling by Spatial Functions
Functions That Create Geometry Values from WKT Values
Functions That Create Geometry Values from WKB Values
MySQL-Specific Functions That Create Geometry Values
Geometry Format Conversion Functions
Geometry Property Functions
General Geometry Property Functions
Point Property Functions
LineString and MultiLineString Property Functions
Polygon and MultiPolygon Property Functions
GeometryCollection Property Functions
Function which Configures Group Replication Primary
Functions which Configure the Group Replication Mode
Functions to Inspect and Configure the Maximum Consensus Instances of a Group
Functions to Inspect and Set the Group Replication Communication Protocol Version
Functions to Set and Reset Group Replication Member Actions
Functions Used with Global Transaction Identifiers (GTIDs)
Asynchronous Replication Channel Failover Functions
Position-Based Synchronization Functions
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:

mysql> SET @s1 = ST_GeomFromText('GEOMETRYCOLLECTION()');
mysql> SET @s2 = ST_GeomFromText('GEOMETRYCOLLECTION EMPTY');
mysql> SELECT ST_AsWKT(@s1), ST_AsWKT(@s2);
+--------------------------+--------------------------+
| ST_AsWKT(@s1)            | ST_AsWKT(@s2)            |
+--------------------------+--------------------------+
| GEOMETRYCOLLECTION EMPTY | GEOMETRYCOLLECTION EMPTY |
+--------------------------+--------------------------+

Unless otherwise specified, functions in this section handle their geometry arguments as follows: If any geometry argument is NULL or is not a syntactically well-formed geometry, or if the SRID argument is NULL , the return value is NULL . 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 key = value . The only permitted key value is axis-order , with permitted values of lat-long , long-lat and srid-defined (the default). If the options argument is NULL , the return value is NULL . If the options 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], 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.

mysql> SET @g = "MULTILINESTRING((10 10, 11 11), (9 9, 10 10))";
mysql> SELECT ST_AsText(ST_GeomCollFromText(@g));
+--------------------------------------------+
| ST_AsText(ST_GeomCollFromText(@g))         |
+--------------------------------------------+
| MULTILINESTRING((10 10,11 11),(9 9,10 10)) |
+--------------------------------------------+
  • 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.

  •  
    推荐文章
    慷慨的烈马  ·  C++ 特殊符号的全部意思_c++符号大全表解释-CSDN博客
    10 月前
    害羞的篮球  ·  ChatYuan首页、文档和下载 - 对话语言大模型 - OSCHINA - 中文开源技术交流社区
    2 年前
    瘦瘦的烤红薯  ·  jasypt对Spring boot的数据源密码进行加密 - 墨天轮
    2 年前
    温文尔雅的橡皮擦  ·  有哪些比较好的爬虫技术交流论坛或群? - 知乎
    2 年前
    大气的伏特加  ·  「python大小写」相关问答|文档|产品|活动 - 七牛云
    2 年前
    今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
    删除内容请联系邮箱 2879853325@qq.com
    Code - 代码工具平台
    © 2024 ~ 沪ICP备11025650号