LoginSignup
0
1

More than 5 years have passed since last update.

Pythonで世界地図-24(都府県の境界線、各国の州等の境界線)

Posted at

日本の県境、世界の国々の州等の境界線(南北アメリカ大陸はありません)のシェイプファイルを利用する。

シェイプファイルのダウンロード

Natural Earth
http://www.naturalearthdata.com/downloads/


「Large scale data, 1:10m」 「Cultural」 「Admin 1 – States, Provinces」 「Download states and provinces」
をダウンロードする。

#!/usr/bin/python3
# coding: UTF-8

import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from geonamescache import GeonamesCache
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from mpl_toolkits.basemap import Basemap

font = {'family':'IPAGothic'} #日本語Fontを指定

map = Basemap(lon_0 = 155,resolution='i',projection='cyl')

map.drawcoastlines()
map.drawcountries()

map.drawmapboundary(fill_color='aqua')
map.fillcontinents(color='gray')

shapefile = 'ne_10m_admin_1_states_provinces/ne_10m_admin_1_states_provinces'

map.readshapefile(shapefile, 'prefectural_bound', color='#444444', linewidth=.2)

plt.show()

image.png

日本の県境及び南北アメリカ大陸を除く世界各国の州等の境界線が描画される。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1