[R-sig-Geo] Geonames elevation help

Michael Denslow mwdenslow at yahoo.com
Tue Nov 25 17:10:30 CET 2008


Dear List,

I am hoping that someone can help me with the GNsrtm3 function in the Geonames package. I am trying to get elevation values for more than one lat,long stored in a data frame. I am not sure if this function can process more than one request since it is a web query. But since R seems to be able to do anything, I figured I was missing something.

I am an R novice so any help would be most appreciated. Here is a shortened example of what I am trying to do.

library(geonames)

long <- c(-81.66,-82.66)
lat <- c(36.21,37.21)
df <- data.frame(lat,long)
GNsrtm3(df$lat,df$long)

# the result below is only for the first set of coordinates
  srtm3    lng   lat
1   990 -81.66 36.21

I also tried using apply, but it also only seemed to work for the first set of coordinates.

Thanks in advance,
Michael


Michael Denslow

I.W. Carpenter Jr. Herbarium [BOON]
Appalachian State University
Boone, North Carolina U.S.A.

-- AND --

Communications Manager
Southeastern Regional Network of Expertise and Collections
sernec.org




More information about the R-sig-Geo mailing list