首页 > 解决方案 > 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!!

标签: pythonopenstreetmap

解决方案


推荐阅读