R-Blogger블로그·해설한국어2025-11-22
8000미터 봉우리
Day 1 of 30DayMapChallenge: “Points” 8000m 이상 봉우리를 “eight-thousanders”라고 부르며, 이 글에서는 그 중에서도 정상 위도가 8000m를 초과하고 주봉(높이 차이)가 500m를 넘는 주요 봉우리를 지도화합니다. 데이터 수집 옵션 영어 위키피디아에는 지리 좌표가 없고, 다른 언어 위키피디아는 좌표를 제공하지만 SPARQL 쿼리가 제대로 동작하지 않으며, OSM 관계를 바로 가져올 수 없습니다. 결국 직접 Overpass API를 호출해 데이터를 가져왔으며, {osmdata} 패키지를 사용해도 가능했지만 여기에선 직접 호출했습니다. 필요한 R 패키지 library(httr) library(glue) library(dplyr) library(tidyr) library(purrr) library(tibble) library(stringr) library(sf) library(leaflet) 데이터 가져오기 및 전처리 overpass_query map(enframe) | map(pivot_wider) | list_rbind() | rename_with(\(x) str_replace(x, "^tags\\.", "")) | st_as_sf(coords = c("lon", "lat"), crs = "EPSG:4326") Table 1: The eight-thousanders Simple feature collection with 14 features and 2 fields Geometry type: POINT Dimension: XY Bounding box: xmin: 74.58954 ymin: 27.70301 xmax: 88.14748 ymax: 35.88168 Geodetic CRS: WGS 84 # A tibble: 14 × 3 name elevation geometry <chr> <dbl> <POINT> 1 Mount Everest 8848.86 (86.92521 27.98806) 2 K2 8611 (76.51333 35.88168) 3 Kangchenjunga 8586 (88.14748 27.70301) 4 Lhotse 8516 (86.9325 27.96199) 5 Mount Makalu 8485 (87.08844 27.89144) 6 Cho Oyu 8201 (86.65963 28.09675) 7 Dhaulagiri 8167 (83.48949 28.69761) 8 Manaslu 8163 (84.55973 28.54998) 9 Nanga Parbat 8126 (74.58954 35.23846) 10 Annapurna I 8091 (83.81992 28.59581) 11 Gasherbrum I 8080 (76.69762 35.72468) 12 Broad Peak 8051 (76.56556 35.81369) 13 Gasherbrum II 8034 (76.65327 35.75773) 14 Shishapangma 8027 (85.78207 28.35176) 지도 표시 summits_sf | leaflet() | addTiles(attribution = r"( r.iresmi.net. data and map: OpenStreetMap)") | addCircleMarkers( popup = ~ glue("{name} ({`name:en`}) {ele} m"), clusterOptions = markerClusterOptions() ) Figure 1: The eight-thousanders 위 코드로 생성된 Leaflet 지도에서 각 봉우리가 원형 마커로 표시되며, 마커를 클릭하면 이름과 높이가 팝업에 표시됩니다.
원문 URL
전체 글은 원문 페이지에서 이어서 읽을 수 있습니다.
- 작성자
- R-Blogger
- 출처
- R-Blogger
- 플랫폼
- R-Blogger
- 분류
- 블로그·해설
- 언어
- 한국어
- 발행일
- 2025-11-22