Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version on CRAN no longer works #64

Closed
reidhin opened this issue Jan 11, 2023 · 4 comments
Closed

Version on CRAN no longer works #64

reidhin opened this issue Jan 11, 2023 · 4 comments

Comments

@reidhin
Copy link

reidhin commented Jan 11, 2023

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
Copy link
Contributor

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
Copy link
Contributor

See 3395e91

@PMassicotte
Copy link
Contributor

Fixed in #67

@reidhin
Copy link
Author

reidhin commented Jan 29, 2023

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

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Nov 28, 2024
# rnaturalearth 1.0.1

# rnaturalearth 1.0.0

## Breaking changes

This is a breaking changes release that ends support to `sp` object in
favour of more modern interfaces (`sf` and `terra`). Although that
`sp` is still available on CRAN, it is no longer being actively
developed (https://geocompx.org/post/2023/rgdal-retirement/). This is
the main reason that motivated the choice to transition toward `sf`
(the default) and `terra`.

Users can choose either get an `sf` or `SpatVector` using the
`returnclass` argument:

```
ne_countries(returnclass = "sf")
ne_countries(returnclass = "sv")
```

Affected functions are `ne_countries()`, `ne_coastline()`,
`ne_states()`, `ne_load()` and `ne_download()`.

If changing the return type to `sf` creates too many problems to your
existing code, you can still convert it back to `sp` :

```
countries <- ne_countries(returnclass = "sf")

# option 1
sf::as_Spatial(countries)


# option 2
as(countries, "Spatial")
```

More information about the retirement of `rgdal`, `rgeos` and
`maptools`: https://r-spatial.org/r/2022/04/12/evolution.html

## Bugfix

- Correctly downloading and reading raster object (#96, closes #52).

# rnaturalearth 0.3.4

- This is a maintenance release that document/use the new special sentinel "\_PACKAGE".

# rnaturalearth 0.3.3

- Using `lifecycle` to indicate that support of `sp` object will be
  eventually dropped. Users should now use `ne_download(returnclass =
  "sf")`, instead of `ne_download(returnclass = "sp")`.

- `terra` is now included in the Imports section.

# rnaturalearth 0.3.2

- Added new maintainer and contributors ([#62](ropensci/rnaturalearth#62)).
- Using terra over raster ([#63](ropensci/rnaturalearth#63))

  - See
    <https://r-spatial.org/r/2022/04/12/evolution.html#packages-depending-on-sp-and-raster>
    and
    <https://r-spatial.org/r/2022/12/14/evolution2.html#deprecations-in-retiring-packages>

- Fixes broken data download links.  Now using Amazon hosted URLs as
  - the primary source for downloading data
  - ([#48](ropensci/rnaturalearth#48),
  - [#64](ropensci/rnaturalearth#64)).

# rnaturalearth 0.3.0 2021-10-11

- fix rnaturalearthhires installation #47 thank you Ian Taylor for #43

# rnaturalearth 0.2.0

- add to river options in ne_download() by adding to
  data_list_physical.csv fixing
  [#23](ropensci/rnaturalearth#23)

- update data to new version [Natural Earth
  v4.1](https://www.naturalearthdata.com/blog/miscellaneous/natural-earth-v4-1-0-release-notes/)
  released May 2018.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants