Skip to content

Commit

Permalink
fix stray GA_ReadOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Jun 10, 2024
1 parent 5f66262 commit c9dbfa5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inst/include/gdallibrary/gdallibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ inline List gdal_read_fields(CharacterVector dsn,
inline NumericVector gdal_feature_count(CharacterVector dsn,
IntegerVector layer, CharacterVector sql, NumericVector ex) {
GDALDataset *poDS;
poDS = (GDALDataset*) GDALOpenEx(dsn[0], GDAL_OF_VECTOR, NULL, NULL, NULL );
poDS = (GDALDataset*) GDALOpenEx(dsn[0], GDAL_OF_READONLY | GDAL_OF_VECTOR, NULL, NULL, NULL );
if( poDS == NULL )
{
Rcpp::stop("Open failed.\n");
Expand All @@ -452,7 +452,7 @@ inline NumericVector gdal_feature_count(CharacterVector dsn,
if (sql[0] != "") {
poDS->ReleaseResultSet(poLayer);
}
GDALClose( poDS );
GDALClose( (GDALDatasetH) poDS );

NumericVector out(1);
out[0] = static_cast<double>(nFeature);
Expand All @@ -463,7 +463,7 @@ inline CharacterVector gdal_driver(CharacterVector dsn)
{

GDALDataset *poDS;
poDS = (GDALDataset*) GDALOpenEx(dsn[0], GA_ReadOnly, NULL, NULL, NULL ); // gdal_driver(<any-type>)
poDS = (GDALDataset*) GDALOpenEx(dsn[0], GDAL_OF_READONLY | GDAL_OF_VECTOR, NULL, NULL, NULL ); // gdal_driver(<any-type>)
if( poDS == NULL )
{
Rcpp::stop("Open failed.\n");
Expand Down

0 comments on commit c9dbfa5

Please sign in to comment.