투영법과 좌표 참조 시스템

Python으로 지리공간 데이터 시각화하기

Mary van Valkenburg

Data Science Program Manager, Nashville Software School

투영법

구형 지구를 평면으로 나타낸 지도

Python으로 지리공간 데이터 시각화하기

다양한 지도 투영법

지도 투영법에 관한 xkcd 만화

Python으로 지리공간 데이터 시각화하기

좌표 참조 시스템

EPSG:4326

  • Google Earth에서 사용
  • 단위: 십진수 도(°)

EPSG:3857

  • Google Maps, Bing Maps, OpenStreetMap에서 사용
  • 단위: 미터
Python으로 지리공간 데이터 시각화하기
School Name              Latitude     Longitude
A. Z. Kelley Elementary    36.021       -86.658
Alex Green Elementary      36.252       -86.832
Amqui Elementary           36.273       -86.703
Andrew Jackson Elementary  36.231       -86.623
import geopandas as gpd
schools['geometry'] = gpd.points_from_xy(schools.Longitude, schools.Latitude)
schools.head(4)
School Name                Latitude  Longitude                geometry
A. Z. Kelley Elementary      36.021    -86.658  POINT (-86.658 36.021)
Alex Green Elementary        36.252    -86.832  POINT (-86.832 36.252)
Amqui Elementary             36.273    -86.703  POINT (-86.703 36.273)
Andrew Jackson Elementary    36.231    -86.623  POINT (-86.623 36.231)
Python으로 지리공간 데이터 시각화하기

DataFrame에서 GeoDataFrame 생성

import geopandas as gpd

schools_geo = gpd.GeoDataFrame(schools, 
                               crs = 'epsg:4326', 
                               geometry = schools.geometry)
schools_geo.head(4)
School Name                Latitude  Longitude               geometry
A. Z. Kelley Elementary      36.021    -86.658  POINT (-86.658 36.021)
Alex Green Elementary        36.252    -86.832  POINT (-86.832 36.252)
Amqui Elementary             36.273    -86.703  POINT (-86.703 36.273)
Andrew Jackson Elementary    36.231    -86.623  POINT (-86.623 36.231)
Python으로 지리공간 데이터 시각화하기

CRS 변환

schools_geo.head(2)
School Name              Latitude  Longitude                geometry
A. Z. Kelley Elementary    36.021    -86.658  POINT (-86.658 36.021)
Alex Green Elementary      36.252    -86.832  POINT (-86.832 36.252)
schools_geo.geometry = schools_geo.geometry.to_crs(epsg = 3857)
schools_geo.head(2)
School Name              Latitude  Longitude                      geometry
A. Z. Kelley Elementary    36.021    -86.658  POINT (-9646818.8 4303623.8)
Alex Green Elementary      36.252    -86.832  POINT (-9666119.5 4335484.4)
Python으로 지리공간 데이터 시각화하기

연습해 봅시다!

Python으로 지리공간 데이터 시각화하기

Preparing Video For Download...