래스터 데이터 불러오기와 시각화
이 연습 문제에서는 식생 유형 지도의 래스터 데이터셋(https://www.wri.org 제공)을 사용해 보겠습니다. 래스터 값은 식생 유형을 나타내는 이산값 집합으로 구성되어 있어요. 먼저 데이터를 읽고, 광산 채굴 지점 데이터와 함께 시각화해 보겠습니다.
광산 채굴 지점 데이터셋(mining_sites)은 이미 로드되어 있으며, GeoPandas와 matplotlib도 이미 임포트되어 있습니다.
이 연습은 강의의 일부입니다
Python으로 지리공간 데이터 다루기
연습 안내
rasterio패키지를 임포트하세요.- 식생 지도 GeoTIFF 파일(
"central_africa_vegetation_map_foraf.tif")을 열어 변수src에 할당하세요. rasterio.plot.show()함수를 사용해 래스터 데이터셋을 플로팅하고, 광산 채굴 지점 위치를 빨간색과 마커 크기 1로 추가하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Import the rasterio package
____
# Open the raster dataset
src = rasterio.____("central_africa_vegetation_map_foraf.tif")
# Import the plotting functionality of rasterio
import rasterio.plot
# Plot the raster layer with the mining sites
ax = rasterio.plot.show(____)
mining_sites.plot(____)
plt.show()