Closed jrosen48 closed 4 weeks ago
Thanks @jrosen48
It is possible to download most layers from natural earth using ne_download()
but I hadn't noticed before that it doesn't work for the parks layers. This is because there are separate layers for area, line and point within the zip stored in the Natural Earth website.
This means that the code I expected to work (below), does download the data but then fails to load it.
Afraid I'm not quite sure how to solve that yet.
sfparks <- ne_download(scale=10, type="parks_and_protected_lands", returnclass = 'sf')
trying URL 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_parks_and_protected_lands.zip'
Content type 'application/zip' length 164198 bytes (160 KB)
downloaded 160 KB
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, : Cannot open layer
One could use:
st_read("/vsizip//ne_10m_parks_and_protected_lands.zip", layer = "ne_10m_parks_and_protected_lands_area")
Layers can be listed with:
sf::st_layers("/vsizip//ne_10m_parks_and_protected_lands.zip")
st_read("/vsizip/vsicurl/https://naciscdn.org/naturalearth/10m/cultural/ne_10m_parks_and_protected_lands.zip")
Thanks for creating an incredible package! Is it possible to download data for parks and protected lands?
It is not listed as available in the README(below the heading "To download Natural Earth data not already in the package"), but is listed on the Natural Earth website:
https://www.naturalearthdata.com/downloads/10m-cultural-vectors/