Skip to content

Commit

Permalink
safety check; tidy test script
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Oct 30, 2023
1 parent 1bc3af4 commit 4c9b377
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/gdal_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ 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");
// getFID:
fids[i] = std::to_string(poFeature->GetFID());

Expand Down
6 changes: 0 additions & 6 deletions tests/dplyr.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ if (require(dplyr, quietly = TRUE)) {
options(dplyr.summarise.inform=FALSE)
read_sf(system.file("shape/nc.shp", package="sf"), quiet = TRUE) %>%
st_transform(3857) -> nc
if ((gc <- attr(nc, "sf_column")) != "geometry") {
nc$geometry = st_geometry(nc)
nc = as.data.frame(nc)
nc[gc] = NULL
nc = st_as_sf(nc)
}
nc = st_as_sf(nc, sf_column_name = "geometry")
nc %>% filter(AREA > .1) %>% plot()

Expand Down

0 comments on commit 4c9b377

Please sign in to comment.