有没有办法滤除位于特定区域之外的纬度和经度数据?最好使用Python?

发布于 2025-02-11 06:33:38 字数 300 浏览 2 评论 0原文

我想显示一组映射到温哥华地区的节点。但是,我构建的数据集包含映射到其他区域(例如Burnaby,Richmond,Surrey等)的节点。我的数据被存储为CSV文件的集合,我想通过数据过滤数据解析,以便只有那些包含位于温哥华区域内的纬度和经度的节点(在下图中以黄色矩形标记 - 指定的链接),而其他节点则被忽略。 任何导致此案的导致都将不胜感激!

图像链接: https://ibb.co/y8jhwj4

I want to display a set of nodes that are mapped to the region of Vancouver. However, the dataset that I build on contains nodes that are mapped to other regions such as Burnaby, Richmond, Surrey etc. My data is stored as a collection of csv files, and I want to filter the data parsing through the data so that only those nodes that contain latitude and longitude lying inside the region of Vancouver (marked by a yellow rectangle in the picture below - link specified) are displayed and the others are ignored.
Any leads to this case will be much appreciated!

IMAGE LINK: https://ibb.co/Y8JhWJ4

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

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

发布评论

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

评论(1

恬淡成诗 2025-02-18 06:33:38

我认为您将要应用这样的东西...

import pandas as pd

LATITUDE_KEY = 'Latitude'
LONGITUDE_KEY = 'Longitude'
columns = [ \
  # stuff and
  LATITUDE_KEY,
  LONGITUDE_KEY
]

nodes = pd.read_csv('place_nodes.csv', names=columns)  
nodes = nodes[nodes[LATITUDE_KEY].between(LAT_MIN, LAT_MAX) \
  & nodes[LONGITUDE_KEY].between(LONG_MIN, LONG_MAX)]

I think you will want to apply something like this...

import pandas as pd

LATITUDE_KEY = 'Latitude'
LONGITUDE_KEY = 'Longitude'
columns = [ \
  # stuff and
  LATITUDE_KEY,
  LONGITUDE_KEY
]

nodes = pd.read_csv('place_nodes.csv', names=columns)  
nodes = nodes[nodes[LATITUDE_KEY].between(LAT_MIN, LAT_MAX) \
  & nodes[LONGITUDE_KEY].between(LONG_MIN, LONG_MAX)]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文