rspatial / geodata

download geographic data
GNU General Public License v3.0
151 stars 15 forks source link

`gadm` silently downloads only the first element of `country` #22

Closed AMBarbosa closed 2 years ago

AMBarbosa commented 2 years ago

The code below doesn't complain, but silently downloads only the first country:

countries <- gadm(country = c("Portugal", "Spain", "France"), level = 1, path = tempdir())
unique(countries$COUNTRY)
# [1] "Portugal"

It would be helpful to emit at least a warning message about that. Cheers!

rhijmans commented 2 years ago

This is now vectorized. The countries are rbinded

countries <- gadm(country = c("Netherlands", "Belgium", "Luxembourg"), level = 1, path = tempdir())
plot(countries)
AMBarbosa commented 2 years ago

Even better! Thanks!