我想使用PostGIS创建一个多边形表格。 表格“point
”中的每一行都具有三个点的ID。
表格“point_location
”中存储了点的位置信息。我在谷歌上搜索了这个问题,但没有找到答案。以下代码有什么问题?
SELECT ST_GeomFromText('POLYGON((' || b.x || ' ' || b.y || ',' || c.x || ' ' || c.y || ',' || d.x || ' ' || d.y || ',' || b.x || ' ' || b.y'))',4326)
AS polygon
FROM point a, point_location b, point_location c, point_location d
WHERE a.p1=b.point_id AND a.p2=c.point_id AND a.p3=d.point_id