在从立交桥API查询方式时,是否可以增加返回的点的密度?还是有一种方法可以在不连接独立高速公路之间的间隙的情况下对点进行插值?
我希望能够测量高速公路和多个属性之间的距离。与特定高速公路的距离并不重要,最近的距离也不重要。由于高速公路上各点之间的空间,我现在的解决方案不准确。
pHigh = api.query("""
(
node[highway=primary](34.978011,-116.697296, 36.747345, -113.976445);
way[highway=primary](34.978011,-116.697296, 36.747345, -113.976445);
rel[highway=primary](34.978011,-116.697296, 36.747345, -113.976445);
);
(._;>;);
out center;
""")
pHighCrd = []
pHighCrd += [(float(node.lat), float(node.lon))
for node in pHigh.nodes]
pHighCrd += [(float(way.center_lat), float(way.center_lon))
for way in pHigh.ways]
pHighCrd += [(float(rel.center_lat), float(rel.center_lon))
for rel in pHigh.relations]
#### Show Results
import folium
m = folium.Map(
location=[35.75, -115],
zoom_start=8,
tiles='Stamen Toner'
)
for coord in pHighCrd:
folium.CircleMarker(location=coord, radius=2, fill=True).add_to(m)
m.save("testmap.html")