SELECT
st_astext (
st_transform ( ST_GeomFromText ( st_astext ( P.shape ), 4326 ), 3857 )) bound,
concat ( P.x1, P.x2) m1,
CAST (
REPLACE (
REPLACE (
REPLACE ( ST_AsText ( ST_centroid ( st_transform ( ST_GeomFromText ( st_astext ( P.shape ), 4326 ), 3857 ) )), ' ', ',' ),
'POINT(',
''
),
')',
''
) AS VARCHAR
) point,
( CASE P.x3 WHEN 0 THEN NULL ELSE P.x3 END ) AS m2
FROM
table P
select st_asgeojson(geom) geom,ST_AsGeoJSON (st_centroid (geom)) AS centroid from table
select st_x(st_centroid(geom)) AS x from table
select st_y(st_centroid(geom)) AS y from table
该博客探讨了如何使用ST_AsText, ST_Transform, ST_Centroid等函数进行空间几何处理,包括在不同坐标系间转换、获取几何中心点等操作。内容涉及SQL查询,适用于地理信息系统和数据库管理领域的专业人士。
3668

被折叠的 条评论
为什么被折叠?



