根據經緯度批量獲取海拔高度


## http://www.geonames.org/login 上注冊賬號,並開通免費網頁權限,且不要在內網

##使用geonames API 和R語言

install.packages(c("here","sp","rgbif"))
library(rgbif)
library(here)
library(sp)

 

## 文件頭行名:  Latitude  Longitude

geo=read.csv("input.csv",header=T)
geo=subset(geo,!is.na(Latitude))
head(geo)

#xxx 為你的賬號

options(geonamesUsername = "xxx")
#file.edit(here::here(".Rprofile"))
user <- "xxx"
lats <- geo$Latitude
lons <- geo$Longitude

#srtm1=30m*30m,最高分辨率。
ele=elevation(latitude = lats, longitude = lons, elevation_model = "srtm1",username = user)

write.csv(ele, "output.csv")


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM