Skip to content

Commit

Permalink
closes #2370
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Apr 12, 2024
1 parent 60a7177 commit 937caef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gdal_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,10 @@ Rcpp::List sf_from_ogrlayer(OGRLayer *poLayer, bool quiet, bool int64_as_string,
bool warn_int64 = false, has_null_geometries = false;
OGRFeature *poFeature;
while ((poFeature = poLayer->GetNextFeature()) != NULL) {
if (i > (n - 1))
Rcpp::stop("more features than GetFeatureCount() reported: please report as issue on GitHub");
if (i > (n - 1)) {
Rcpp::warning("more features available than GetFeatureCount() reported: some records may be failing");
break;
}
// getFID:
fids[i] = std::to_string(poFeature->GetFID());

Expand Down

0 comments on commit 937caef

Please sign in to comment.