PostGIS点属性到多边形,其中poligon包含点
我在 PostGIS 中的相同架构下有一个多边形数据库(bdus)和一个点数据库(bdps)。这些数据库是使用 Shapefile 和 DBF 加载器从 shapefile 导入的。我想要做的是根据包含条件加入多边形图层上的点属性。 因此,对于包含 1 到 n 个点的每个多边形,将点列添加到多边形中。如果有多个点,一种好的方法是平均列值。
有人可以指导我吗?我是 PostGreSQL 和 PostGIS 的新手,但我设法运行此查询
SELECT * FROM bdps
JOIN
bdus
ON
ST_Contains(bdus.the_geom, bdps.the_geom);
,该查询返回一个表,其中 bdps 与相应的 bdus 连接,但我想要相反的结果。
预先感谢您的任何帮助!
I have a polygon database (bdus) and a point database (bdps) under the same schema in PostGIS. These databases were imported from shapefiles with the Shapefile and DBF loader. What I want to do is to join the point attributes on the polygon layer based on the contain criteria.
So for every polygon that contain one to n points, to add the columns of points to polygons. If there are more than one point a good approach would be to average column values.
Can someone guide me? I am new to PostGreSQL and PostGIS but I managed to run this query
SELECT * FROM bdps
JOIN
bdus
ON
ST_Contains(bdus.the_geom, bdps.the_geom);
which return a table with bdps joined with the corresponding bdus, but I want the reverse.
Thanks in advance for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的意思是,您想要使用满足 ST_Contains(polys,points) 标准的多边形和点创建一个新的多边形吗?
Did you meant, that you want to create a new polygon with the polygon and the points that satisfy the ST_Contains(polys, points) criteria?