Skip to content

Commit 6e6a23b

Browse files
committed
improve warning/version diagnostics GEOS; #844
1 parent d52e411 commit 6e6a23b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

R/init.R

+8-3
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,15 @@ setOldClass("sfg")
6969
}
7070

7171
.onAttach = function(libname, pkgname) {
72-
m = paste0("Linking to GEOS ", CPL_geos_version(), ", GDAL ", CPL_gdal_version(), ", proj.4 ", CPL_proj_version())
72+
m = paste0("Linking to GEOS ", strsplit(CPL_geos_version(TRUE), "-")[[1]][1],
73+
", GDAL ", CPL_gdal_version(), ", PROJ ", CPL_proj_version())
7374
packageStartupMessage(m)
74-
if (length(grep(sf:::CPL_geos_version(FALSE, TRUE), sf:::CPL_geos_version(TRUE))) != 1)
75-
packageStartupMessage("WARNING: different compile-time and runtime versions for GEOS")
75+
if (length(grep(sf:::CPL_geos_version(FALSE, TRUE), sf:::CPL_geos_version(TRUE))) != 1) {
76+
packageStartupMessage("WARNING: different compile-time and runtime versions for GEOS found:")
77+
packageStartupMessage(paste(
78+
"Linked against:", CPL_geos_version(TRUE, TRUE),
79+
"compiled against:", CPL_geos_version(FALSE, TRUE)))
80+
}
7681
}
7782

7883
#' Provide the external dependencies versions of the libraries linked to sf

0 commit comments

Comments
 (0)