PG数据库的空间函数
2021-04-13 本文已影响0人
WebGiser
计算两点间的空间距离
// ST_DistanceSphere 函数
select ST_DistanceSphere ( ST_SetSRID ( ST_MakePoint ( 115.5894917, 32.644148 ), 4326 ), geom ) FROM PUBLIC.dm
Geometry类型转化为文本类型
// ST_AsText 函数输出结果格式:POINT(115.780783680223 33.8766619946554)
select ST_AsText(geom) coord FROM PUBLIC.dm