python - Open Street MAP 无法检索所有信息
问题描述
我正在尝试从 OSM 检索一些信息,但我无法。我会很感激你的帮助。我正在尝试使用以下代码检索智利圣地亚哥的所有学校:
import pandas as pd
#Define amenities
amenities = ['school']
osm_tags = '"amenity"~"{}"'.format('='.join(amenities))
bbox = [-33.679014,-70.836495,-33.273801,-70.341619]
# request them from the OpenStreetMap API (Overpass)
pois = osm.node_query(bbox[0],bbox[1],bbox[2],bbox[3],tags=osm_tags)
pois = pois[pois['amenity'].isin(amenities)]
#List how many we downloaded
print(pois.amenity.value_counts())
pois[['amenity', 'name', 'lat', 'lon']].head()
df=pd.DataFrame(pois)
df.to_csv('.\santaigo_schools.csv')```
Even though the code works (it saves 1500 schools), it is not retrieving all the schools in this sector, I found many schools that are present in the OSM but they are not in my final file. I would appreciate it if you can help me to understand what is wrong and why the code is not getting those schools
Thanks!!
解决方案
推荐阅读
- ruby-on-rails - Ruby on Rails 应用程序中的 sitemap.xml 问题
- reactjs - 如何将上下文与重定向联系起来
- typescript - 打字稿函数重载“没有重载匹配此调用”
- powershell - Get-ADUser 是否有某种形式的缓存?
- sql-server - 如何在 SQL 中上层 SELECT 的 WHERE 条件中使用子查询中的自定义字段
- javascript - 事件监听器只循环一次
- kubernetes - Kubernetes 目录的服务代理,谷歌云 shell 的简单实现
- reactjs - 如何使用 Docker 容器化多个文件
- deep-learning - 如何在pytorch中将不同通道中不同宽度的样本输入大小设置为Conv1d
- opencv - OpenCV:设置每个 RGB 像素的亮度,使最亮的通道(R、G 或 B)处于最大值