如何将WKT(众所周知的文本)格式的带孔多边形插入postgis表中?
我在postgis中有一个表,它有4列:ID、名称、the_geom、SRID。我需要编写一个 SQL 查询,它将将此外部多边形(元素 1)插入名为“woods”的表中,ID = 44,该外部多边形的名称为“oak”,SRID 为“4412”。
元素 1 和元素 2(孔)的坐标值: 元素 1= [P1(6,15)、P2(10,10)、P3(20,10)、P4(25,15)、P5(25,35)、P6(19,40)、 P7(11,40), P8(6,25), P1(6,15)] 元素 2= [H1(12,15), H2(15,24)]
这是图像: http://download.oracle.com/docs/html/A85337_01/sdo_objb。动图
I have a table in postgis, which has 4 columns: ID, name, the_geom, SRID. I need to write an SQL query which will insert this exterior polygon (Element 1) in the table named "woods", ID = 44, the name of that exterior polygon is "oak", and SRID is "4412".
The coordinate values for Element 1 and Element 2 (the hole):
Element 1= [P1(6,15), P2(10,10), P3(20,10), P4(25,15), P5(25,35), P6(19,40),
P7(11,40), P8(6,25), P1(6,15)]
Element 2= [H1(12,15), H2(15,24)]
Here is the image:
http://download.oracle.com/docs/html/A85337_01/sdo_objb.gif
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看一下
ST_MakePolygon
:Take a look at
ST_MakePolygon
:替代解决方案是使用 几何构造函数 函数 ST_GeomFromText,
其中 SRID 示例等于 EPSG:4326
Alternative solution is to use geometry constructor function ST_GeomFromText
with example of SRID equal to EPSG:4326