MySQL空间数据类型官方文档:https://dev.mysql.com/doc/refman/8.0/en/spatial-types.html
- 创建一个支持空间数据类型的表
CREATE TABLE FEATURE
(
ID VARCHAR(36) NOT NULL,
LAYER_ID VARCHAR(36) NOT NULL,
FEATURE_ID VARCHAR(36) NOT NULL,
GEO_DATA GEOMETRY NOT NULL,
PRIMARY KEY (ID)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC
-
创建空间索引
-
插入一条数据
INSERT INTO FEATURE VALUES(‘9267EE68-E5DC-B800-7B3E-C8E9F7897D1B‘,‘‘,‘‘,ST_GeomFromText(‘POINT(112.927755 27.91046)‘))
MySQL空间分析函数官方文档:https://dev.mysql.com/doc/refman/8.0/en/spatial-analysis-functions.html