Skip to content

Commit 89e4e98

Browse files
committed
maybe fix build on old gdal
1 parent 57a7bbd commit 89e4e98

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/gdal_read_stream.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class GDALStreamWrapper {
6868
}
6969
};
7070

71+
#endif
72+
7173
// [[Rcpp::export]]
7274
Rcpp::List CPL_read_gdal_stream(
7375
Rcpp::RObject stream_xptr,
@@ -80,6 +82,8 @@ Rcpp::List CPL_read_gdal_stream(
8082
Rcpp::CharacterVector fid_column,
8183
int width) {
8284

85+
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,6,0)
86+
8387
const char* array_stream_options[] = {"INCLUDE_FID=NO", nullptr};
8488
if (fid_column.size() == 1) {
8589
array_stream_options[0] = "INCLUDE_FID=YES";
@@ -115,18 +119,11 @@ Rcpp::List CPL_read_gdal_stream(
115119
}
116120

117121
return Rcpp::List::create(wkt_str, Rcpp::NumericVector::create(num_features));
118-
}
119122

120123
#else
121124

122-
Rcpp::RObject CPL_read_gdal_stream(Rcpp::CharacterVector datasource, Rcpp::CharacterVector layer,
123-
Rcpp::CharacterVector query,
124-
Rcpp::CharacterVector options, bool quiet, Rcpp::CharacterVector drivers,
125-
Rcpp::CharacterVector wkt_filter,
126-
bool dsn_exists = true,
127-
bool dsn_isdb = false,
128-
int width = 80) {
129125
Rcpp::stop("read_stream() requires GDAL >= 3.6");
130-
}
131126

132127
#endif
128+
129+
}

0 commit comments

Comments
 (0)