如何找到远离某个多边形的所有点?

发布于 2024-09-06 02:09:36 字数 280 浏览 2 评论 0原文

我需要的是找到距矩形 10 公里的所有点。点几何图形是the_geom1,矩形(多边形)几何图形是the_geom2。它们的SRID是4258。

我尝试过:

SELECT * 
FROM table1,table2 
WHERE ST_DWithin(table1.the_geom1,table2.the_geom2,10000) 
      and table1.gid=2;

但结果不好。我得到太多结果(所有内容都返回)。

我做错了什么?

What I need is to find all points away from rectangle for 10km. Points geometry is the_geom1, rectangles (polygon) geometry is the_geom2. SRID of them is 4258.

I tried:

SELECT * 
FROM table1,table2 
WHERE ST_DWithin(table1.the_geom1,table2.the_geom2,10000) 
      and table1.gid=2;

But the result is not Ok. I get way too many results (everything is returned).

What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

错爱 2024-09-13 02:09:36

您的查询应该有效。大问题可能如 https://gis 中所述。 stackexchange.com/questions/32711/how-do-i-use-st-dwithin-with-meters 讨论单位转换问题。

您可能在单位选择或配置方面遇到问题。

例如,如果你告诉它几何形状必须在 10000 英里以内,那么你几乎可以得到任何地方。即使是 10000 公里,也可能会将所有东西都带回同一片大陆。

Your query should work. The big issue may be as described in https://gis.stackexchange.com/questions/32711/how-do-i-use-st-dwithin-with-meters which discusses unit conversion issues.

You may have an issue with unit selection or configuration.

If you are telling it, for example, that the geometries must be within 10000 miles, you would get just about everywhere. Even 10000km would likely return everything on the same continent.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文