ropensci / rnaturalearth

An R package to hold and facilitate interaction with natural earth map data :earth_africa:
http://ropensci.github.io/rnaturalearth/
Other
214 stars 24 forks source link

Version on CRAN no longer works #64

Closed reidhin closed 1 year ago

reidhin commented 1 year ago

The version of this package (rnaturalearth) that is published on CRAN seems to no longer work. Let me illustrate this issue below, and also suggest a solution, if I may.

Issue Version 0.1.0 of rnaturalearth is published on CRAN. When trying to download datasets using this version of the package, I obtain the following error:

> library(rnaturalearth)
> spdf_world <- ne_download( scale = 110, type = 'countries' )
trying URL 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip'
Error in utils::download.file(file.path(address), zip_file <- tempfile()) : 
  cannot open URL 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip'
In addition: Warning message:
  In utils::download.file(file.path(address), zip_file <- tempfile()) :
  cannot open URL 'https://www.naturalearthdata.com/http/www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip': HTTP status was '404 Not Found'

Indeed, trying the url's from the error message in a webbrowser shows that these urls no longer exist. The correct url in this case would be: https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip Note the "https" in front and the double slash after http: ".com/http//www.naturalearth". It seems as if naturalearth.com no longer supports "http" and only allows "https".

Solution The development version of rnaturalearth on github has already advanced to version 0.3.0. When installing this version of the package with devtools from github as devtools::install_github("ropensci/rnaturalearth") the error is gone. This version retrieves the datasets from elsewhere.

Suggestion I think it would be a good idea to update the published version of this package on CRAN with the development version (if that version is sufficiently mature) to avoid the error.

andysouth commented 1 year ago

Hello @reidhin Many thanks for your setting out your comment so clearly. You are right. We are looking for some help with package maintenance (see #62 and will endeavour to submit to CRAN soon).

PMassicotte commented 1 year ago

See https://github.com/ropensci/rnaturalearth/commit/3395e9181394b86a5ee253153ff8b6986cf76620

PMassicotte commented 1 year ago

Fixed in #67

reidhin commented 1 year ago

Many thanks @PMassicotte for the update on CRAN, seems to work flawlessly!