Conversion for latitude/longitude to altitude in R

前端 未结 4 1144
野趣味
野趣味 2021-02-06 02:44

Does anyone know if there is a tool in R to find the height above sea level of a location, given the latitude and longitude ?

4条回答
  •  忘掉有多难
    2021-02-06 03:19

    Or you can use the package that looks up from geonames, and get the value from the srtm3 digital elevation model:

    > require(geonames)
    > GNsrtm3(54.481084,-3.220625)
      srtm3       lng      lat
    1   797 -3.220625 54.48108
    

    or the gtopo30 model:

    > GNgtopo30(54.481084,-3.220625)
      gtopo30       lng      lat
    1     520 -3.220625 54.48108
    

    geonames is on CRAN so install.packages("geonames") will get it.

    The difference between these two models is because they are only approximations based on satellite data. Don't go expecting to pinpoint mountains from this.

提交回复
热议问题