根据经纬度批量获取海拔高度


## 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