postgis 函数学习

学习postgis 的funciton

select 'LINESTRING(40 100, 98 100, 100 150, 60 90)'::geometry; -- 先画一条线
select ST_Buffer('LINESTRING(40 100, 98 100, 100 150, 60 90)'::geometry, 40, 'endcap=square'); -- 扩展这条线
select 'LINESTRING(50 50,150 150,150 50)'::geometry;
select ST_Buffer(ST_GeomFromText('LINESTRING(50 50,150 150,150 50)'), 100, 'endcap=round join=round');  -- 端点为圆形 接头处为圆形
select ST_Buffer(ST_GeomFromText('LINESTRING(50 50,150 150,150 50)'), 10, 'endcap=round join=round'); -- 端点为圆形 接头处为圆形
select ST_Buffer(ST_GeomFromText('LINESTRING(50 50,150 150,150 50)'), 100, 'endcap=square join=round');   -- 端点为方形 接头圆形 

-- endcap 可以为 'round', 'flat', 'butt' or 'square' “圆形”、“扁平”、“对接”或“方形”
-- join 可以为'round', 'mitre', 'miter' or 'bevel'

  -- “圆形”、“斜接”、“斜接”或“斜面”

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章