공간 데이터와 속성 탐색 및 시각화

Python으로 지리공간 데이터 다루기

Joris Van den Bossche

Open source software developer and teacher, GeoPandas maintainer

데이터 필터링

countries.head()
          name      continent       gdp                            geometry
0  Afghanistan           Asia   64080.0  POLYGON ((61.21 35.65, 62.23 35...
1       Angola         Africa  189000.0  MULTIPOLYGON (((23.90 -11.72, 2...
...
countries['continent'] == 'Africa'
0      False
1       True
         ...  
175     True
176     True
Name: continent, Length: 177, dtype: bool
Python으로 지리공간 데이터 다루기

데이터 필터링

countries_africa = countries[countries['continent'] == 'Africa']
countries_africa.plot()

Python으로 지리공간 데이터 다루기

공간 데이터 시각화

countries.plot()

Python으로 지리공간 데이터 다루기

색상 조정: 단일 색상

countries.plot(color="red")

Python으로 지리공간 데이터 다루기

색상 조정: 속성값 기반

countries.plot(column='gdp_per_cap')

Python으로 지리공간 데이터 다루기

다층 플롯

fig, ax = plt.subplots(figsize=(12, 6))
countries.plot(ax=ax)
cities.plot(ax=ax, color='red', markersize=10)
ax.set_axis_off()

Python으로 지리공간 데이터 다루기

연습해 봅시다!

Python으로 지리공간 데이터 다루기

Preparing Video For Download...