前言
這些是用於在地圖圖像上按照經緯度、地區、風格等等編程繪製個性信息的工具。
用途廣泛、專業。例如畫一張人口分佈熱力圖、疾病分佈圖等等。
方法一:vincent
鏈接:http://wrobstory.github.io/2013/04/python-maps-choropleth.html
效果:
方法二:matplotlib 的擴展——Basemap
鏈接:https://matplotlib.org/basemap/index.html
下載:https://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/
效果:
樣例代碼:https://matplotlib.org/basemap/users/examples.html
方法三:mapsplotlib
鏈接:https://github.com/tcassou/mapsplotlib
優點:封裝了谷歌地圖作爲底層圖層
缺點:需要一個谷歌的API key,可能要翻牆
效果:
方法四:MapBox SDK for Python
原理:將繪製請求上傳到Mapbox服務器,由服務器返回繪製結果
鏈接:https://github.com/mapbox/mapbox-sdk-py
文檔:https://github.com/mapbox/mapbox-sdk-py/tree/master/docs
優點:方便簡單
缺點:需要註冊申請一個mapbox的api key
效果:
方法五:pymaps
鏈接:https://code.google.com/archive/p/pymaps/wikis/PymapsHowto.wiki
下載:https://code.google.com/archive/p/pymaps/downloads
優點:似乎是谷歌內部做的,更具權威性
缺點:2008年開始就定型了,沒人維護了;同樣需要谷歌api key
方法六:Cartopy
鏈接:https://scitools.org.uk/cartopy/docs/latest/index.html
安裝:https://scitools.org.uk/cartopy/docs/latest/installing.html#installing
文檔:https://scitools.org.uk/cartopy/docs/latest/gallery/index.html
效果: