MySQL/POINT:修订间差异
来自康健生活
< MySQL
| 第39行: | 第39行: | ||
== 函数 == | == 函数 == | ||
=== ST_GeomFromText === | === ST_GeomFromText === | ||
ST_GeomFromText(wkt, srid)可以返回 MySQL 支持的任何空间类型,可以用 WKT 表示。 | |||
=== ST_PointFromText === | === ST_PointFromText === | ||
2022年8月9日 (二) 10:12的版本
测试数据
mysql 之后的版本,空间数据类型的操作函数在命名上统一在前面加上
ST,如 GeomFromText 改为 ST_GeomFromText。创建测试表和字段。
添加数据还可以使用其他语句。
SET @tempdata = 'POINT(100 100)';
INSERT INTO `test-location`(location, text) VALUES (
ST_GeomFromText(@tempdata),
'测试点3'
);
/** or **/
SET @tempdata = ST_GeomFromText('POINT(100 100)');
INSERT INTO `test-location`(location, text) VALUES (
@tempdata,
'测试点4'
);
函数
ST_GeomFromText
ST_GeomFromText(wkt, srid)可以返回 MySQL 支持的任何空间类型,可以用 WKT 表示。
ST_PointFromText
查询数据
ST_AsText 模板:Leftrightflex
更新数据
Well-known binary (WKB)
Well-known binary[1]。
| Type | 2D | Z | M | ZM |
|---|---|---|---|---|
| Geometry | 0000 |
1000 |
2000 |
3000
|
| Point | 0001 |
1001 |
2001 |
3001
|
| LineString | 0002 |
1002 |
2002 |
3002
|
| Polygon | 0003 |
1003 |
2003 |
3003
|
| MultiPoint | 0004 |
1004 |
2004 |
3004
|
| MultiLineString | 0005 |
1005 |
2005 |
3005
|
| MultiPolygon | 0006 |
1006 |
2006 |
3006
|
| GeometryCollection | 0007 |
1007 |
2007 |
3007
|
| CircularString | 0008 |
1008 |
2008 |
3008
|
| CompoundCurve | 0009 |
1009 |
2009 |
3009
|
| CurvePolygon | 0010 |
1010 |
2010 |
3010
|
| MultiCurve | 0011 |
1011 |
2011 |
3011
|
| MultiSurface | 0012 |
1012 |
2012 |
3012
|
| Curve | 0013 |
1013 |
2013 |
3013
|
| Surface | 0014 |
1014 |
2014 |
3014
|
| PolyhedralSurface | 0015 |
1015 |
2015 |
3015
|
| TIN | 0016 |
1016 |
2016 |
3016
|
| Triangle | 0017 |
1017 |
2017 |
3017
|
| Circle | 0018 |
1018 |
2018 |
3018
|
| GeodesicString | 0019 |
1019 |
2019 |
3019
|
| EllipticalCurve | 0020 |
1020 |
2020 |
3020
|
| NurbsCurve | 0021 |
1021 |
2021 |
3021
|
| Clothoid | 0022 |
1022 |
2022 |
3022
|
| SpiralCurve | 0023 |
1023 |
2023 |
3023
|
| CompoundSurface | 0024 |
1024 |
2024 |
3024
|
| BrepSolid | |
1025 |
|
|
| AffinePlacement | 102 |
1102 |
|
|
- ↑ wikipedia. Well-known text representation of geometry[OL]. https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary.
No categories