我們正在爲我們的活動制定標準化報告。我需要的最後一張圖是顯示活動的地理區域(有近100個地點)。使用OSM或其他shapefile和matplotloib繪製標準化報告地圖
這些報告的輸出爲PDF信紙或A4尺寸
該報告是mplotlib人物,其中:
fig = plt.figure(figsize=(8.5, 11))
rect0 = 0, .7,, 0.18, 0.3
rect1 = .3, .7, .18, .3
rect2 = .8, .29, .2, .7
rect3 = 0, 0, .8, .4
ax1 = fig.add_axes(rect0)
ax2 = fig.add_axes(rect1)
ax3 = fig.add_axes(rect2)
ax4 = fig.add_axes(rect3)
的內容和佈局軸線1-3定居和工作的偉大。然而ax4是地圖內容顯示的地方(理想情況)。
我希望做這樣的事情:
map1 = Basemap(llcrnrlon=6.819087, llcrnrlat=46.368452, urcrnrlon=6.963978,
urcrnrlat=46.482906, resolution = 'h', projection='tmerc',
lon_0=6.88, lat_0=46.42, ax=4)
map1.readshapefile('a valid shape file that works') #<----- this is the sticking point
map1.draw(insert locator coordinates)
plt.savefig(report to be inserted to document)
plt.show()
但是我還沒有成功地獲得了一個形狀文件,從開放街道地圖或地理信息系統的工作原理。
我也沒有確定從openstreetmaps轉換數據的正確過程。
我也沒有確定從OSM/xml文檔或轉換後的GeoJSON文檔中提取該信息的過程。
理想情況下,我想從openstreetmaps中獲取邊界框信息並直接生成地圖。
獲取與.readshapefile()調用一起使用的shapefile的過程是什麼?
或者,我該如何將定義的地圖變成Matplotlib軸?
謝謝你會試試看。 –