Mysql空间数据,空间索引,SpatialData,SpatialIndex
(2019-03-10 11:01:11)| 分类: mysql |
转自:http://www.cnblogs.com/linkerCRed/p/5443200.html
前文:
这两天因为项目原因看了一下MySQL的空间索引,发现网上的资料不多,查了一下官方文档,为了强化记忆做了一个简单的翻译。基本上理解了mysql空间索引的要点。谨以此纪。
Extensions for Spatial Data
Open Geospatial Consortium (OGC) 是一个由超过两百五十个公司,机构,大学组成的致力于发展管理空间数据的解决方案的组织。-
用于表示空间值得数据类型 Data types for representing spatial values
-
用于操作空间值得方法Functions for manipulating spatial values
-
提高访问空间列速度的空间索引Spatial indexing for improved access times to spatial columns
-
一个实体,例如一座山,一个池塘,一个城市 An entity. For example, a mountain, a pond, a city.
-
一个空间,例如城区,热带地区A space. For example, town district, the tropics.
-
一个确定的位置。例如一个特定两条街交叉的十字路口A definable location. For example, a crossroad, as a particular place where two streets intersect.
MySQL GIS Conformance(一致性) and Compatibility(兼容性)
Mysql 没有实现以下GIS特性:LineString MultiLineString的方法length()
应该使用ST_Length()Additional Resources
Spatial Data Types
-
GEOMETRY 几何体 -
POINT 点 -
LINESTRING 线 -
POLYGON 多边形
-
MULTIPOINT 多点 -
MULTILINESTRING 多线 -
MULTIPOLYGON 多个多边形 -
GEOMETRYCOLLECTION 几何集合
GEOMETRYCOLLECTION可以存放任意类型的集合。其他类型需要特定几何类型
12.5.2 The OpenGIS Geometry Model
OGC's SQL with Geometry
Types推荐的几何类型基于OpenGIS Geometry
Model.在这个模型中每个几何包含以下通用的属性:
-
它由一个空间关系系统关联起来,这个系统描述了对象定义的坐标空间。
-
他属于一些几何类
12.5.2.1 The Geometry Class Hierarchy几何类层级
-
Geometry(noninstantiable)几何 -
Point(instantiable)点 -
Curve(noninstantiable)曲线 -
LineString(instantiable)线串 -
Line线 -
LinearRing线圈
-
-
-
Surface(noninstantiable) 面 -
Polygon(instantiable)多边形
-
-
GeometryCollection(instantiable)几何集合 -
MultiPoint(instantiable)多点 -
MultiCurve(noninstantiable)多曲线 -
MultiLineString(instantiable)多线串
-
-
MultiSurface(noninstantiable)多面 -
MultiPolygon(instantiable) 多个多边形
-
-
-
Geometry是基本类,他是一个虚拟类。Geometry可实例化子类限制在0、1/2维几何对象,这个对象存在于一个二维坐标空间。所有可实例化几何类被定义可以判断几何类型实例是否是
topologically closed(拓扑闭,也就是说所有的几何类型包含他们的边界)Point, Curve, Surface, and GeometryCollection-
点表示0维对象 Pointrepresents zero-dimensional objects. -
Curve曲线代表一维对象,他有LineString线串子类(子-子类=》Line线,LinearRing线圈) -
面Surface表示一个二 维对象,他有Polygon多边形这个子类 -
GeometryCollection几何集合有专门的0/1/2维集合类叫做MultiPoint,MultiLineString, andMultiPolygon来建立 Points,LineStrings, andPolygons集合相应的几何模型, .MultiCurveand MultiSurface是做为处理 Curvesand Surfaces几何的接口引进的虚拟父类。
12.5.2.2 Geometry Class
Geometry是层级中的root
class,他是不可实例化类,但是包含一些属性,这些属性是所有Geometry子类共有的。
Geometry
Properties
-
Its type. 每一个geometry属于层级中的某一个可实例化类。 -
Its
SRID, or Spatial Reference Identifier.空间关系标示,这个值标识了geometr关联的空间关系系统,系统描述了几何对象在其中定义的坐标空间。 In MySQL, the SRID value是一个整数关联到几何value.所有的计算通过欧几里得(平面)几何所得.
SRID最大值是232−1. 如果提供了一个更大值只会取其低32位。 -
Its
coordinates 在他的空间关系系统中的坐标。由双精度(8-byte)数据表示. 所有的非空几何体包含至少一对(X,Y)坐标.空几何体不包含任何坐标. 坐标Coordinates和SRID相关 .例如,在不同的坐标系统,两个对象即使这两个对象有相同的坐标但是距离可能会不同,,因为在平面
planar 坐标系统的距离和在地理测量geodetic 系统(地球表面上的系统坐标)的距离是不同的东西. -
Its
interior内部, boundary边界, and exterior外部. 每一个几何占据了一些空间中的位置。 几何体的外部是指所有没有被几何体占用的空间.内部是指几何体占据的空间。边界是指内部和外部间的交接处
-
Its
MBR (最小边框矩形minimum bounding rectangle), 或者envelope封闭线. 这个是边界几何体,由最大的坐标和最小的坐标组成(X,Y): ((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))
-
Whether the value is
simple or nonsimple. ( LineString,MultiPoint,MultiLineString)类型的几何值既不是simple 也不是 nonsimple.每个类型自行决定自己是simple or nonsimple. -
Whether the value is
closed or not closed. ( LineString,MultiString)的Geometry values 既不是closed 也不是 not closed. .每个类型自行决定自己是 closed or not closed. -
Whether the value is
empty or nonempty 如果一个几何体不包含任何点则为empty. empty几何体的内部外部和边界都没有定义 ( 用 NULL表示).一个空几何体总是simple的包含的区域为0。 -
Its
dimension维度. 维度有 −1, 0, 1, or 2: -
−1 空几何体
-
0
没有长度没有空间的几何体 -
1 非零长度但是0空间的几何体
-
2 非零空间的几何体
Point是zero. LineString是 1.Polygon是 2.MultiPoint,MultiLineString, andMultiPolygon由他们包含的组件维度决定 -
12.5.2.3 Point Class
Point
Point
-
想象一个大比例尺的世界地图,一个点可以用来表示一个城市
-
在一个城市地图,一个点可以用来表示一个公交站
Point
-
X-coordinate value.
-
Y-coordinate value.
-
维度为0 -
边界为空
12.5.2.4 Curve Class
A Curve 是一维几何体, 通常表示一个序列的点.
其子类定义了点和点之间的插入类型 Curve
Curve
-
包含他的所有点的坐标
-
1维度的几何体
-
如果不通过同一个点两次则为simple, 例外的情况是它的开始和结束是同一个点
-
起始点和终结点相同的话为closed
-
closed的边界为空
-
nonclosed 的边界视为他的两个端点
-
如果既是simple又是closed的则为
LinearRing.
12.5.2.5 LineString Class
A LineString
LineString
-
世界地图上,
LineString 可以表示河流 -
城市地图上,可以表示街道
LineString
-
A
LineStringhas coordinates of segments, defined by each consecutive pair of points. -
A
LineStringis a Lineif it consists of exactly two points. -
A
LineStringis a LinearRingif it is both closed and simple.
12.5.2.6 Surface Class
A Surface Polygon.
Surface
-
二维几何体.
-
The OpenGIS specification定义一个简单的
Surface是由单一的“patch”组成,这个“patch”是由一个外部边界和零个或多个内部边界关联起来 -
simple Surface 的边界是由一系列的closed curves对应的外部和内部边界
12.5.2.7 Polygon Class
A Polygon是一个平面Surface
Polygon
-
On a region map,
Polygonobjects could represent forests, districts, and so on.
Polygon
-
边界由一系列的
LinearRing对象组成它的外部和内部边界 -
没有交叉的圈. 圈可能会相交在一点,但是只能是切点。
-
A
Polygonhas no lines, spikes, or punctures. -
A
Polygonhas an interior that is a connected point set. -
可能有孔. The exterior of a
Polygonwith holes is not connected. Each hole defines a connected component of the exterior.
前面的判断使得Polygon成为simple几何体.
12.5.2.8 GeometryCollection Class
A GeometryCollection
所有的子项必须在同一个空间关系系统(相同的坐标空间). 除此之外没有其他额外约束, 但是GeometryCollection的子类可能限制子项资格.
限制条件基于:
-
子项类型 (for example, a
MultiPointmay contain only Pointelements) -
维度
-
约束元素之间的空间重叠的程度
12.5.2.9 MultiPoint Class
A MultiPoint是一个由Point 子项组成的集合.
这些点无论如何没有联系或者顺序.
MultiPoint
-
世界地图上,可以表示一列的小岛屿
-
城市地图上,可以表示售票网店
MultiPoint
-
零维度
-
如果没有两点是相同的则为simple。
-
边界为空
12.5.2.10 MultiCurve Class
A MultiCurve 是有 Curve MultiCurve
MultiCurve
-
一维度
-
当且仅当他的子项都是simple他为simple。任意两个子项之间唯一的交叉发生在两个子项的边界点上
-
A
MultiCurveboundary is obtained by applying the “mod 2 union rule” (also known as the “odd-even rule”): A point is in the boundary of a MultiCurveif it is in the boundaries of an odd number of Curveelements. -
A
MultiCurveis closed if all of its elements are closed. -
The boundary of a closed
MultiCurveis always empty.
12.5.2.11 MultiLineString Class
A MultiLineString MultiCurve LineString
MultiLineString
-
在一个地区地图上,可以用来表示河流系统或者铁路系统
12.5.2.12 MultiSurface Class
A MultiSurface MultiPolygon.
MultiSurface
-
其中的Surfaces没有内部相交
-
其中的Surface相交点数有限.
12.5.2.13 MultiPolygon Class
A MultiPolygon MultiSurface Polygon
MultiPolygon
-
可以用来表示地区湖系统
MultiPolygon
-
没有两个Polygon内部相交。
-
两个Polygon不可以相交(相交也是在前面一个条件中禁止的)或者接触无限个点
-
一个
MultiPolygon可能没有切线,spikes,或者穿孔.MultiPolygon是 一个规则的,closed的点集合 -
A
MultiPolygon有不止一个Polygon有不连接的内部. The number of connected components of the interior of aMultiPolygonis equal to the number of Polygonvalues in the MultiPolygon.
MultiPolygon
-
二维
-
A
MultiPolygon的边界是一系列的closed curves (LineStringvalues) corresponding to the boundaries of its Polygonelements. -
Each
Curvein the boundary of the MultiPolygonis in the boundary of exactly one Polygonelement. -
Every
Curvein the boundary of an Polygonelement is in the boundary of the MultiPolygon.
12.5.3 Using Spatial Data
这个章节描述如何创建包含空间数据类型列的表,以及如何操作空间信息.
12.5.3.1 Supported Spatial Data Formats
有两个标准的空间数据格式被用来表示集合对象Two standard spatial data formats are used to represent geometry objects in queries:
-
Well-Known Text (WKT) format
-
Well-Known Binary (WKB) format
在内部,MySQL存储几何值到一个既不是WKT也不是WKB的格式。
12.5.3.1.1 Well-Known Text (WKT) Format
Examples of WKT representations of geometry objects:
-
A
Point:POINT(15 20)
点坐标之间没有用逗号分隔。这个和
SQL Point()方法不同,后者需要用逗号隔开坐标.注意使用适当的语法到给定空间操作的上下文。例如下面的语句都是从Point对象中取出X坐标。第一个直接使用Point() 函数,第二个使用WKT的GeomFormText()转换Point
The first produces the object directly using thePoint()function. The second uses a WKT representation converted to a Pointwith GeomFromText().mysql> SELECT ST_X(Point(15, 20)); +---------------------+ | ST_X(POINT(15, 20)) | +---------------------+ | 15 | +---------------------+ mysql> SELECT ST_X(ST_GeomFromText('POINT(15 20)')); +---------------------------------------+ | ST_X(ST_GeomFromText('POINT(15 20)')) | +---------------------------------------+ | 15 | +---------------------------------------+ -
A
LineString有四个点:LINESTRING(0 0, 10 10, 20 25, 50 60)
点和点直接由逗号分开
-
A
带有一个外部圈和一个内部圈的PolygonPOLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7, 5 5))
-
多点:
MULTIPOINT(0 0, 20 20, 60 60)
在5.7.9中,空间函数例如
ST_MPointFromText()and ST_GeomFromText()接受WKT格式化的MutilPoint数值中使用圆括号把点包裹起来.例如下面两个函数调用都是有效的。但是,在5.7.9之前的版本,第二种方式会产生错误: ST_MPointFromText('MULTIPOINT (1 1, 2 2, 3 3)') ST_MPointFromText('MULTIPOINT ((1 1), (2 2), (3 3))')在5.7.9中,输出的MultiPoint值会使用圆括号把每个点包裹起来
mysql> SET @mp = 'MULTIPOINT(1 1, 2 2, 3 3)'; mysql> SELECT ST_AsText(ST_GeomFromText(@mp)); +---------------------------------+ | ST_AsText(ST_GeomFromText(@mp)) | +---------------------------------+ | MULTIPOINT((1 1),(2 2),(3 3)) | +---------------------------------+
5.7.9之前的输出不会带有括号
mysql> SET @mp = 'MULTIPOINT(1 1, 2 2, 3 3)'; mysql> SELECT ST_AsText(ST_GeomFromText(@mp)); +---------------------------------+ | ST_AsText(ST_GeomFromText(@mp)) | +---------------------------------+ | MULTIPOINT(1 1,2 2,3 3) | +---------------------------------+
-
A
MultiLineStringwith two LineStringvalues: MULTILINESTRING((10 10, 20 20), (15 15, 30 15))
-
A
MultiPolygonwith two Polygonvalues: MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((5 5,7 5,7 7,5 7, 5 5)))
-
A
GeometryCollectionconsisting of two Pointvalues and one LineString:GEOMETRYCOLLECTION(POINT(10 10), POINT(30 30), LINESTRING(15 15, 20 20))
12.5.3.1.2 Well-Known Binary (WKB) Format
The
Well-Known Binary (WKB) 使用转换几何数据成二进制流representation of geometric
values is used for exchanging geometry data as binary streams
represented by BLOB
0101000000000000000000F03F000000000000F03F
这个序列由以下组件组成:
Byte order: 01 WKB type: 01000000 X coordinate: 000000000000F03F Y coordinate: 000000000000F03F
Component representation is as follows:
-
byte是由0/1表示低位高位存储。 这种方法也被称为Network Data Representation (NDR) and External Data Representation (XDR), respectively.
-
The WKB type是用来表明几何体类型. 值从1到7分别表示
Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon, andGeometryCollection. -
一个Point值有X,Y坐标。每个坐标由一个双精度数值表示
12.5.3.2 Creating Spatial Columns
MySQL
提供了一个标准的方法去为几何类型创建空间列。例如, 在 CREATE TABLE ALTER TABLE中.
空间列在 MyISAM, InnoDB, NDB, and ARCHIVE
-
使用
CREATE TABLE语法创建一个带有空间列的表 CREATE TABLE geom (g GEOMETRY);
-
使用
ALTER TABLE语法添加或者删除一个表中的空间列 ALTER TABLE geom ADD pt POINT; ALTER TABLE geom DROP pt;
12.5.3.3 填充Populating Spatial Columns
创建空间列之后,你可以填充进去空间数据。数值必须存储为内部几何格式的值。但是你可以转换成
下面的例子插入了更加复杂的几何数据到表中
SET @g = 'LINESTRING(0 0,1 1,2 2)';
INSERT INTO geom VALUES (ST_GeomFromText(@g));
SET @g = 'POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7, 5 5))';
INSERT INTO geom VALUES (ST_GeomFromText(@g));
SET @g ='GEOMETRYCOLLECTION(POINT(1 1),LINESTRING(0 0,1 1,2 2,3 3,4 4))';
INSERT INTO geom VALUES (ST_GeomFromText(@g));
前面的语句使用了ST_GeomFromText() ST_GeomFromText()
SET @g = 'POINT(1 1)'; INSERT INTO geom VALUES (ST_PointFromText(@g)); SET @g = 'LINESTRING(0 0,1 1,2 2)'; INSERT INTO geom VALUES (ST_LineStringFromText(@g)); SET @g = 'POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7, 5 5))'; INSERT INTO geom VALUES (ST_PolygonFromText(@g)); SET @g = 'GEOMETRYCOLLECTION(POINT(1 1),LINESTRING(0 0,1 1,2 2,3 3,4 4))'; INSERT INTO geom VALUES (ST_GeomCollFromText(@g));
一个应用程序想要在查询服务器的时候使用WKB 表示几何数值.下面有几个方法实现这个需求。例如
-
插入一个
POINT(1 1)使用二进制语法:mysql> INSERT INTO geom VALUES -> (ST_GeomFromWKB(0x0101000000000000000000F03F000000000000F03F)); -
一个ODBC应用可以发送一个WKB表达式,并把他绑定到一个占位符上,使用
BLOB类型: INSERT INTO geom VALUES (ST_GeomFromWKB(?))
其他程序接口可能支持类似的占位符机制
-
C 语言中,你可以使用
mysql_real_escape_string()跳过一个二进制数值,包含结果到一个查询字符串中
12.5.3.4 读取Fetching Spatial Data
Geometry数值存储在表格中可以读取到内部格式,你可以转换成WKT或者WKB格式
-
读取空间数据到内部格式:
读出来的内部格式在表和表之间传递很有用
CREATE TABLE geom2 (g GEOMETRY) SELECT g FROM geom;
-
读取到WKT格式:
ST_AsText()方法将内部格式转换成WKT字符串 SELECT ST_AsText(g) FROM geom;
-
读取到WKB格式:
ST_AsBinary()方法将内部格式转换到一个 包含WKB值得 BLOBSELECT ST_AsBinary(g) FROM geom;
12.5.3.5 优化空间分析Optimizing Spatial Analysis
对于MyISAM InnoDB SPATIAL
-
Point 搜索:搜索包含一个给定的点的所有对象
-
地区搜索:搜索与给定区域重叠的所有对象
MySQL使用
同样也可能创建普通索引到空间列上,在一个非空间索引, you must declare a prefix for any
spatial column except for POINT
MyISAM InnoDB SPATIAL SPATIAL
12.5.3.7 Using Spatial Indexes
13.15 Spatial Analysis Functions
-
创建各种格式几何图形函数
(WKT, WKB, internal) -
几何图形格式之间的转换函数
-
几何的定性或定量属性的访问函数
-
描述两个图形之间的关系函数
-
从现有的创建新的几何图形函数
13.15.1 Spatial Function Reference
The following table lists each spatial function and provides a short description of each one.
Table
| Name | Description |
|---|---|
Area() |
Return Polygon or MultiPolygon area |
AsBinary(), AsWKB() |
Convert from internal geometry format to WKB |
AsText(), AsWKT() |
Convert from internal geometry format to WKT |
Buffer() |
Return geometry of points within given distance from geometry |
Centroid() |
Return centroid as a point |
Contains() |
Whether MBR of one geometry contains MBR of another |
ConvexHull() |
Return convex hull of geometry |
Crosses() |
Whether one geometry crosses another |
Dimension() |
Dimension of geometry |
Disjoint() |
Whether MBRs of two geometries are disjoint |
Distance() |
The distance of one geometry from another |
EndPoint() |
End Point of LineString |
Envelope() |
Return MBR of geometry |
Equals() |
Whether MBRs of two geometries are equal |
ExteriorRing() |
Return exterior ring of Polygon |
GeomCollFromText(), GeometryCollectionFromTe |
Return geometry collection from WKT |
GeomCollFromWKB(), GeometryCollectionFromWK |
Return geometry collection from WKB |
GeometryCollection() |
从几何图形构造几何图形集合
|
GeometryN() |
Return N-th geometry from geometry collection |
GeometryType() |
Return name of geometry type |
GeomFromText(), GeometryFromText() |
Return geometry from WKT |
GeomFromWKB(), GeometryFromWKB() |
Return geometry from WKB |
GLength() |
Return length of LineString |
InteriorRingN() |
Return N-th interior ring of Polygon |
Intersects() |
Whether MBRs of two geometries intersect |
IsClosed() |
Whether a geometry is closed and simple |
IsEmpty() |
Placeholder function |
IsSimple() |
Whether a geometry is simple |
LineFromText(), LineStringFromText() |
Construct LineString from WKT |
LineFromWKB(), LineStringFromWKB() |
Construct LineString from WKB |
LineString() |
构造 |
MBRContains() |
一个几何的MBR包含了另一个的MBR |
MBRCoveredBy() |
一个MBR是否被另一个覆盖 |
MBRCovers() |
一个MBR是否覆盖了另一个 |
MBRDisjoint() |
两个几何体的MBR是否分离 |
MBREqual() |
Whether MBRs of two geometries are equal |
MBREquals() |
两个几何体的MBR是否相同 |
MBRIntersects() |
两个几何体的MBR是否相交 |
MBROverlaps() |
两个几何体的MBR是否重叠 |
MBRTouches() |
两个几何体的MBR是否触碰 |
MBRWithin() |
一个几何体的MBR是否在另一个的MBR里面 |
MLineFromText(), MultiLineStringFromText() |
Construct MultiLineString from WKT |
MLineFromWKB(), MultiLineStringFromWKB() |
Construct MultiLineString from WKB |
MPointFromText(), MultiPointFromText() |
Construct MultiPoint from WKT |
MPointFromWKB(), MultiPointFromWKB() |
Construct MultiPoint from WKB |
MPolyFromText(), MultiPolygonFromText() |
Construct MultiPolygon from WKT |
MPolyFromWKB(), MultiPolygonFromWKB() |
Construct MultiPolygon from WKB |
MultiLineString() |
Contruct MultiLineString from LineString values |
MultiPoint() |
Construct MultiPoint from Point values |
MultiPolygon() |
Construct MultiPolygon from Polygon values |
NumGeometries() |
Return number of geometries in geometry collection |
NumInteriorRings() |
Return number of interior rings in Polygon |
NumPoints() |
Return number of points in LineString |
Overlaps() |
Whether MBRs of two geometries overlap |
Point() |
Construct Point from coordinates |
PointFromText() |
Construct Point from WKT |
PointFromWKB() |
Construct Point from WKB |
PointN() |
Return N-th point from LineString |
PolyFromText(), PolygonFromText() |
Construct Polygon from WKT |
PolyFromWKB(), PolygonFromWKB() |
Construct Polygon from WKB |
Polygon() |
Construct Polygon from LineString arguments |
SRID() |
Return spatial reference system ID for geometry |
ST_Area() |
返回 Polygon or MultiPolygon 范围 |
ST_AsBinary(), ST_AsWKB() |
将内部格式转换成WKB |
ST_AsGeoJSON() |
从几何体中生成GeoJSON |
ST_AsText(), ST_AsWKT() |
将内部格式转换成WKT |
ST_Buffer() |
返回给定几何体给定距离内的几何体的点 |
ST_Buffer_Strategy() |
ST_Buffer()生成策略选项 |
ST_Centroid() |
返回几何中心点 |
ST_Contains() |
是否一个几何体包含另外一个 |
ST_ConvexHull() |
Return convex hull of geometry |
ST_Crosses() |
是否一个几何体和其他的交叉 |
ST_Difference() |
返回两个几何体不同的点集合 |
ST_Dimension() |
几何体维度 |
ST_Disjoint() |
一个几何体是否和另一个分离 |
ST_Distance() |
两个几何体的距离 |
ST_Distance_Sphere() |
两个几何体在地球上的最小距离 |
ST_EndPoint() |
返回LineString的结束点 |
ST_Envelope() |
返回几何体MBR |
ST_Equals() |
两个几何体是否相等 |
ST_ExteriorRing() |
返回Polygon的外部圈 |
ST_GeoHash() |
生成geohash值 |
ST_GeomCollFromText(), ST_GeometryCollectionFromTe, ST_GeomCollFromTxt() |
返回从 WKT生成的几何体集合 |
ST_GeomCollFromWKB(), ST_GeometryCollectionFromWK |
返回从 WKB生成的几何体集合 |
ST_GeometryN() |
返回集合中第N个几何体 |
ST_GeometryType() |
返回几何体类型 |
ST_GeomFromGeoJSON() |
从GeoJSON对象生成几何体 |
ST_GeomFromText(), ST_GeometryFromText() |
从 WKT返回几何体 |
ST_GeomFromWKB(), ST_GeometryFromWKB() |
从WKB返回几何体 |
ST_InteriorRingN() |
返回Polygon的第N个内部环 |
ST_Intersection() |
返回两个几何体的交叉点集合 |
ST_Intersects() |
一个几何体是否和另一个交叉 |
ST_IsClosed() |
一个几何体是否是simple且closed |
ST_IsEmpty() |
Placeholder function |
ST_IsSimple() |
Whether a geometry is simple |
ST_IsValid() |
Whether a geometry is valid |
ST_LatFromGeoHash() |
从geohash返回纬度 |
ST_Length() |
Return length of LineString |
ST_LineFromText(), ST_LineStringFromText() |
Construct LineString from WKT |
ST_LineFromWKB(), ST_LineStringFromWKB() |
Construct LineString from WKB |
ST_LongFromGeoHash() |
从geohash返回经度 |
ST_MakeEnvelope() |
两点之间的矩形 |
ST_MLineFromText(), ST_MultiLineStringFromText() |
Construct MultiLineString from WKT |
ST_MLineFromWKB(), ST_MultiLineStringFromWKB() |
Construct MultiLineString from WKB |
ST_MPointFromText(), ST_MultiPointFromText() |
Construct MultiPoint from WKT |
ST_MPointFromWKB(), ST_MultiPointFromWKB() |
Construct MultiPoint from WKB |
ST_MPolyFromText(), ST_MultiPolygonFromText() |
Construct MultiPolygon from WKT |
ST_MPolyFromWKB(), ST_MultiPolygonFromWKB() |
Construct MultiPolygon from WKB |
ST_NumGeometries() |
返回集合中的几何体个数 |
ST_NumInteriorRing(), ST_NumInteriorRings() |
|
ST_NumPoints() |
返回LineString中点的个数 |
ST_Overlaps() |
是否一个几何体和另一个重叠 |
ST_PointFromGeoHash() |
从geohash转换成POINT值 |
ST_PointFromText() |
从WKT生成POINT |
ST_PointFromWKB() |
从WKB生成POINT |
ST_PointN() |
返回LineString的第N点 |
ST_PolyFromText(), ST_PolygonFromText() |
Construct Polygon from WKT |
ST_PolyFromWKB(), ST_PolygonFromWKB() |
Construct Polygon from WKB |
ST_Simplify() |
返回简化的几何体 |
ST_SRID() |
返回几何体的空间关系系统ID |
ST_StartPoint() |
LineString的开始点 |
ST_SymDifference() |
Return point set symmetric difference of two geometries |
ST_Touches() |
一个几何体是否触碰到另一个 |
ST_Union() |
返回两个几何体所有点的联合集合 |
ST_Validate() |
Return validated geometry |
ST_Within() |
一个几何体是否在另一个中 |
ST_X() |
返回点的X坐标 |
ST_Y() |
返回点的Y坐标 |
StartPoint() |
Start Point of LineString |
Touches() |
Whether one geometry touches another |
Within() |
Whether MBR of one geometry is within MBR of another |
X() |
Return X coordinate of Point |
Y() |
Return Y coordinate of Point |

加载中…