Hi community
Im want to calculate the altitude from coordinates data, with library(raster)
But with some countries, like Puerto Rico, I have problems.
library(raster)
library(tibble)
df <- tribble(
~GNUMBER, ~ DI_LATITUD_NEW, ~DI_LONGITUD_NEW,
"G10263", 41.70, -8.17,
"G22652", 2.69, -16.84,
"G22656A", 32.67,-17.05,
"G22659", 32.73,-16.79,
)
m <- data.frame(lon =df$DI_LONGITUD_NEW ,
lat = df$DI_LATITUD_NEW )
x <- getData('alt', country = "PRT") # PRT is Puerto Rico
###### show this ERROR #####
# trying URL 'https://biogeo.ucdavis.edu/data/diva/msk_alt/PRT_msk_alt.zip'
# Content type 'application/zip' length 196373 bytes (191 KB)
# downloaded 191 KB
# returning a list of RasterLayer objects
# Warning message:
# In getData("alt", country = "PRT") :
# getData will be removed in a future version of raster
# . Please use the geodata package instead
dfull5_PRT <- cbind(m, alt = extract(x, m))
Any idea how make this calculations, maybe with other library
Tnks!