python plot map_plot_map: A tool to add map(osm/mapbox) background in python matplotlib

更新 Update

2020.3.35

增加绘制指北针和比例尺的功能plotscale(ax)

add the function plotscale, now you can plot the compass and scale on the map!

2020.3.24

可将下载的地图保存,下次使用时直接读取!

set the imgsavepath to save the tile map

imgsavepath -- Path to save the tile map so that you don't have to download again

2020.3.22

绘图过程增加了timeout为6s,尝试次数10次,妈妈再也不用担心plot_map画图卡很久

add 6s timeout and maximun try 10 times

plot_map

plot_map是一个基于matplotlib的工具,在用geopandas或者pyplot绘制地理图形的时候,你可以用plot_map来添加地图底图

When you want to plot geo object using python geopandas or matplotlib.pyplot, you can use this module to generate map backgroud.

只需要用以下代码:

Just use the following code:

plot_map(plt,bounds,zoom = 9,style = 1)

你可以通过改变参数"style"和"styleid"来改变底图的风格样式

You can change your map style by changing the "style" and "styleid" in the function plot_map

bounds -- Set your plotting boundary [lon1,lat1,lon2,lat2] (wgs1984)

zoom -- The zoom level of the map

style -- From 1 to 7 represent different map styles,1-6 is from openstreetmap and 7 is the mapbox

styleid -- if style is set as 7(from mapbox), you can change the styleid here, "dark" or "light" or your own style

imgsavepath -- Path to save the tile map so that you don't have to download again

printlog -- Show the log

可以实现的效果:

example:

更多信息请看:

see more in the ipynb: Tutorial(Tutorial_of_plot_map.ipynb)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值