Skip to content

Commit a88e29c

Browse files
committed
add warning if proj and GDAL disagree about network enablement
1 parent 21d385a commit a88e29c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/proj.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ Rcpp::CharacterVector CPL_get_data_dir(bool b = false) {
188188
// [[Rcpp::export]]
189189
Rcpp::LogicalVector CPL_is_network_enabled(bool b = false) {
190190
#if PROJ_VERSION_MAJOR >= 7
191+
#if GDAL_VERSION_NUM >= 3040000
192+
if (OSRGetPROJEnableNetwork() != proj_context_is_network_enabled(PJ_DEFAULT_CTX))
193+
Rcpp::warning("GDAL and PROJ have different settings for network enablement; use sf_use_network() to sync them");
194+
#endif
191195
return Rcpp::LogicalVector::create(proj_context_is_network_enabled(PJ_DEFAULT_CTX));
192196
#else
193197
return Rcpp::LogicalVector::create(false);

0 commit comments

Comments
 (0)