python 画一张中国地图 geopandas 城市地图 DATAV.GeoAtlas

地图json获取:
DATAV.GeoAtlas
http://datav.aliyun.com/tools/atlas/#&lat=30.332329214580188&lng=106.72278672066881&zoom=3.5

import requests
from geopandas import GeoDataFrame
from shapely.geometry import shape
import matplotlib.pyplot as plt
def get_bound_and_save_json():
    url = "https://geo.datav.aliyun.com/areas_v2/bound/100000.json"
    r = requests.get(url)
    return r.json()['features'][0]['geometry']
b = shape(get_bound_and_save_json())
geodf = GeoDataFrame([{
    
    'geometry': b}])
geodf.plot()
plt.title("China")
plt.xlabel('lon')
plt.ylabel('lat')
plt.grid()
plt.show()

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/x1131230123/article/details/114364487