rOpenSpain / Siane

R package to represent statistical data on official Spanish maps at several administrative levels
Other
10 stars 2 forks source link

Error with readOGr #1

Closed joscani closed 7 years ago

joscani commented 7 years ago

Follow your example I get an error

shp <- get_siane_map(obj = obj, level = level, year = year, canarias = canarias)
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv,  : 
  Cannot open file
joscani commented 7 years ago

I believe you should change path_to_map function to

path_to_map <- function (codes) 
{
paste("se89_3_admin", codes[1], "a", codes[2], 
                   sep = "_")

}
joscani commented 7 years ago

If you use absolute path in register_siane your code works!!

Nuniemsis commented 7 years ago

Great! Thank you for the feedback. I will point it out on the function's documentation.