GeoServer 学习(三) 空间函数

1、转换十六进制为实际坐标
st_astext()
Post几何数据类型:
1.点:point(0,0)
例如:create TABLE liqunTest(gid int,typeName VARCHAR, geom geometry);
insert into liquntest(gid,typename,geom) VALUES(1,’点’,’POINT(0 0) ‘);
2.线:LINESTRING(0 0,1 1,1 2)
insert into liquntest(gid,typename,geom) VALUES(2,’线’,’LINESTRING(0 0,1 1,1 2)’);
3.面:POLYGON((0 0,4 0,4 4,0 4,0 0)
insert into liquntest(gid,typename,geom) VALUES(3,’面’,’POLYGON((0 0,4 0,4 4,0 4,0 0))’);
3.多面:POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))
insert into liquntest(gid,typename,geom) VALUES(4,’多面’,’POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))’);
4.多点:MULTIPOINT(0 0,1 2)
insert into liquntest(gid,typename,geom) VALUES(4,’多点’,’MULTIPOINT(0 0,1 2)’);
5.多线:MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4))
insert into liquntest(gid,typename,geom) VALUES(5,’多线’,’MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4))’);
执行:SELECT gid,typename,st_astext(geom) from liquntest; 后得到如下结果
还有很多函数,需要自行百度。 搜 Post GIS 常用函数

转载自:https://blog.csdn.net/qq_35170213/article/details/80006325

You may also like...

退出移动版