示例演示 --点(POINT) drop table if exists dmpoint; create table dmpoint(name varchar(100),geom ST_Point); insert into dmpoint VALUES ('p1',dmgeo2.ST_PointFromText('point (1 1)',4326)); insert into dmpoint VALUES ('p2',dmgeo2.ST_PointFromText('point (2 2)',4326)); --线(LINESTRING) drop table if exists dmLine; create table dmLine(name varchar(100),geom ST_LineString); insert into dmLine VALUES ('L1',dmgeo2.ST_LineFromText('linestring(0 0,1 1,2 1,2 2)' ,4326)); insert into dmLine VALUES ('L1',dmgeo2.ST_LineFromText('linestring(0 0,1 1,2 2,3 3)' ,4326)); --面(POLYGON) drop table if exists dmPOLYGON; create table dmPOLYGON(name varchar(100),geom ST_POLYGON); insert into dmPOLYGON VALUES ('Polygon1',dmgeo2.ST_PolygonFromText('polygon ((0 0, 1 0, 1 1, 0 1, 0 0))', 4326)); insert into dmPOLYGON VALUES ('Polygon1',dmgeo2.ST_PolygonFromText('POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))', 4326)); --多点 drop table if exists dmMpoint; create table dmMpoint(name varchar(100),geom ST_Multipoint); insert into dmMpoint VALUES ('mp1',dmgeo2.ST_MPointFromText('multipoint (1 1, 2 2)',4326)); insert into dmMpoint VALUES ('mp2',dmgeo2.ST_MPointFromText('MULTIPOINT(0 0,1 2)',4326)); --多线 drop table if exists dmMline; create table dmMline(name varchar(100),geom ST_Multilinestring); insert into dmMline VALUES ('mltline1',dmgeo2.ST_MLineFromText('multilinestring ((1 1,2 1),(4 4, 3 3))',4326)); insert into dmMline VALUES ('mltline2',dmgeo2.ST_MLineFromText('MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4))', 4326)); --多面 drop table if exists dmMpolygon; create table dmMpolygon(name varchar(100),geom ST_Multipolygon); insert into dmMpolygon VALUES ('mpolygon1',dmgeo2.ST_MPolyFromText ('multipolygon (((1 1, 1 2, 2 2, 2 1, 1 1)), ((3 3, 3 4, 4 4, 4 3, 3 3)))', 4326)); insert into dmMpolygon VALUES ('mpolygon2',dmgeo2.ST_MPolyFromText ('MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))', 4326)); --几何集合 drop table if exists dmCOLLECTION; CREATE TABLE dmCOLLECTION (name varchar(100), geom ST_Geometry); insert into dmCOLLECTION VALUES ('Col1',dmgeo2.ST_GeomFromText('GEOMETRYCOLLECTION(point(2 0),POLYGON((0 0,1 0,1 1,0 0)))',4326)); insert into dmCOLLECTION VALUES ('Col2',dmgeo2.ST_GeomFromText('GEOMETRYCOLLECTION(POLYGON((4 0,8 0,8 4,4 0)),LINESTRING(2 3,3 4))',4326)); insert into dmCOLLECTION VALUES ('Col3',dmgeo2.ST_GeomFromText('GEOMETRYCOLLECTION(point (1 1),linestring(0 0,1 1,2 2,3 3))',4326));
标签:学习,insert,dmgeo2,into,4326,空间数据,VALUES,ST,达梦 From: https://www.cnblogs.com/fangzpa/p/17757105.html