Skip to content

Commit

Permalink
Version 1.3.0 RC (#270)
Browse files Browse the repository at this point in the history
Avoid using showSRID() explicitly
  • Loading branch information
ranghetti authored Feb 4, 2020
1 parent 70d60c5 commit adf4732
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 35 deletions.
18 changes: 9 additions & 9 deletions R/st_as_text_2.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ st_as_text_2 <- function(x, pretty = FALSE) {
packageVersion("rgdal") >= 1.5
)) {
x_crs <- st_crs(x)
rgdal::showSRID(
if (is.na(x_crs$epsg)) {
x_crs$proj4string
} else {
paste0("EPSG:",x_crs$epsg)
},
format = "WKT2",
multiline = if (pretty == TRUE) {"YES"} else {"NO"}
)
x_proj <- if (is.na(x_crs$epsg)) {
x_crs$proj4string
} else {
paste0("EPSG:",x_crs$epsg)
}
srid_multiline <- if (pretty == TRUE) {"YES"} else {"NO"}
eval(parse(
text = "rgdal::showSRID(x_proj, format = 'WKT2', multiline = srid_multiline)"
))
} else {
st_as_text(x, pretty = pretty)
}
Expand Down
27 changes: 1 addition & 26 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,4 @@
* [R-hub] macOS 10.11 El Capitan, R-release (experimental)

## R CMD check results

There was 1 NOTE:
```
* checking dependencies in R code ... NOTE
Missing or unexported object: 'rgdal::showSRID'
```

This note is due to the fact that 'showSRID' is a function implemented
in `rgdal >= 1.5-2` (available at http://R-Forge.R-project.org/).
This function is necessary to correctly handle WKT2 representations of CRS
starting from PROJ >= 3 (http://rgdal.r-forge.r-project.org/articles/PROJ6_GDAL3.html),
but can not be included in NAMESPACE since CRAN version of `rgdal` is 1.4-8.

Nevertheless:

1. **rgdal** is a dependence of sen2r;
2. `showSRID()` can not be called by **sen2r** unless the r-forge version of
package **rgdal** was manually installed: in fact, the function is called
only in the following `if` cycle:
```
if (all(
package_version(sf_extSoftVersion()["proj.4"]) >= 6,
packageVersion("rgdal") >= 1.5
))
```
There were no ERRORs, WARNINGs or NOTEs.

0 comments on commit adf4732

Please # to comment.