将数据框转换为空间对象并找到包含点的多边形

发布于 2025-01-11 12:21:26 字数 454 浏览 2 评论 0原文

我有两个数据框。第一个包含一系列位置的经度和纬度坐标。它看起来像这样:

df1

第二个数据框包含网格数据,头部如下。经度范围为(-10.70,-5.35),纬度范围为(51.33,55.38)。

df2

我需要找到包含数据框 1 中给出的每个城市的值的网格。我是否需要将其转换为空间对象,或者是否可以直接从数据框进行转换?我怎样才能做到这一点?

I have two data frames. The first contains the longitude and latitude coordinates for a series of locations. And it looks like this:

df1

The second data frame contains gridded data, the head is as follows. The longitude range is (-10.70, -5.35) and the latitude range is (51.33, 55.38).

df2

I need to find the grid that contains the value of each city given in data frame 1. Do I need to convert it to a spatial object or is it possible to do it directly from the data frames? How can I do that?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文