Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/break_antimeridian.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' }
st_break_antimeridian = function(x, lon_0=0, tol=0.0001, ...) {
ll = st_is_longlat(x)
if (!ll | is.na(ll))
if (!isTRUE(ll))
stop("'st_break_antimeridian' requires non-projected geographic coordinates",
call. = FALSE)

Expand Down
2 changes: 1 addition & 1 deletion R/db.R
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ db_find_srid = function(conn, crs_local = st_crs(srid), srid = epsg(crs_local),
}
crs_found <- st_crs(db_crs[["srtext"]])
crs_found[["input"]] <- build_epsg(srid)
if(validate && crs_found != crs_local & !is.na(crs_local)) {
if(validate && crs_found != crs_local && !is.na(crs_local)) {
# TODO: pretty print db_spatial_ref
warning("Local crs different from database crs. You can inspect the ",
"database crs using `dbReadtable(conn, \"spatial_ref_sys\")` ",
Expand Down
2 changes: 1 addition & 1 deletion R/sample.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ st_sample.sfc = function(x, size, ..., type = "random", exact = TRUE, warn_if_no
st_multipoints_sample(do.call(c, x), size = size, ..., type = type),
st_ll_sample(st_cast(x, "LINESTRING"), size = size, ..., type = type),
st_poly_sample(x, size = size, ..., type = type, by_polygon = by_polygon))
if (exact & type == "random" & all(st_geometry_type(res) == "POINT")) {
if (exact && type == "random" && all(st_geometry_type(res) == "POINT")) {
diff = size - length(res)
if (diff > 0) { # too few points
res_additional = st_sample_exact(x = x, size = diff, ...,
Expand Down
2 changes: 1 addition & 1 deletion R/sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ st_sf = function(..., agr = NA_agr_, row.names,
x
else if (length(x) == 1) # ONLY one sfc
data.frame(row.names = row.names)
else if (!sfc_last & inherits(x, "data.frame"))
else if (!sfc_last && inherits(x, "data.frame"))
x
else if (sfc_last && inherits(x, "data.frame"))
x[-all_sfc_columns]
Expand Down
2 changes: 1 addition & 1 deletion R/shift_longitude.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @export
st_shift_longitude = function(x) {
ll = st_is_longlat(x)
if (!ll | is.na(ll))
if (!isTRUE(ll))
stop("'st_shift_longitude' requires non-projected geographic coordinates",
call. = FALSE)

Expand Down