USEPA / elevatr

An R package for accessing elevation data
Other
203 stars 26 forks source link

get_elev_point() error #96

Open jresasco opened 10 months ago

jresasco commented 10 months ago

Hi Jeffrey

Thanks for your work on this package.

I'm coming back to some elevatr code that was working previously but now something seems to be wrong. Here's the error:

Error in `[.data.frame`(x, coords) : undefined columns selected

Here's the chunk.

coords <- data.frame(obs$decimalLongitude,obs$decimalLatitude)
elevs <- get_elev_point(locations = coords, units="meters",  prj = "EPSG:4326", src = "epqs")

I tried specifying src = "aws" but the error is the same.

Here's a sample of what the first few rows of coords

> coords[1:3,]
  obs.decimalLongitude obs.decimalLatitude
1            -105.4198            39.84143
2            -105.2032            38.54277
3            -104.9507            39.60565

R version 4.2.2 (2022-10-31) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.6.9 elevatr_0.99.0

Thanks for any advice on how to get this working again!

Julian

jresasco commented 10 months ago

Ah! looks like I just needed to call the columns "x" and "y". colnames(coords)<-c("x","y") All set - thanks