PostGIS,可以从某些点创建多边形 [英] PostGIS, Is possible to create a Polygon from some Points
本文介绍了PostGIS,可以从某些点创建多边形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗯,
我曾经根据纬度和经度创建点或多边形.使用类似的东西:
I used to create Points or Polygons from latitude and longitud. Using something like that:
ST_Transform(ST_GeomFromText('POINT("+longitud+" "+latitud+")' ,4326),23030)
但在那一刻,我的来源是数千个点的几何值,我想从中创建一个几何多边形值.但我不知道是否有可能.
But on that moment my source are geometry values of thousands of points, and I would like to create a geometry Polygon value from them. But I don´t know if it is possible.
我还有 UTM 坐标(我的是 30 S),但我认为从几何开始会更容易.
Also I have UTM coordinates(mine is 30 S), but I think that starting from geometry would be easier.
如果有人能帮助我,我将不胜感激.
If someone could help me, I would be so gratefull.
谢谢
推荐答案
可以收集point
的数组,转换为geometry[]
,并使用ST_MakeLine
.
You can collect an array of point
, cast to geometry[]
, and use ST_MakeLine
.
SELECT ST_MakePolygon(ST_MakeLine( ARRAY[ point(1,2), point(3,4), point(5,6) ]::geometry[] ));
这篇关于PostGIS,可以从某些点创建多边形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文