|
87 | 87 | #' if `quiet` is equal to `FALSE`, then vectortranslate operations will |
88 | 88 | #' display a progress bar. |
89 | 89 | #' @param boundary An `sf`/`sfc`/`bbox` object that will be used to create a |
90 | | -#' spatial filter during the vectortranslate operations. The type of filter |
91 | | -#' can be chosen using the argument `boundary_type`. If `place` is an `sf`/`sfc` |
92 | | -#' polygon or a `bbox`, then it will be used as `boundary` if the latter is not |
93 | | -#' specified. |
| 90 | +#' spatial filter during the vectortranslate operations. If you are running |
| 91 | +#' `oe_get()` and `place` is an `sf`/`sfc` polygon or a `bbox`, then it will |
| 92 | +#' be used as `boundary` if the latter is not specified. Set `boundary = NA` |
| 93 | +#' to override this behaviour and forcefully import the full extract. |
94 | 94 | #' @param boundary_type A character vector of length 1 specifying the type of |
95 | 95 | #' spatial filter. The `spat` filter selects only those features that |
96 | 96 | #' intersect a given area, while `clipsrc` also clips the geometries. Check |
@@ -264,11 +264,22 @@ oe_get = function( |
264 | 264 | file_url = matched_zone[["url"]] |
265 | 265 | file_size = matched_zone[["file_size"]] |
266 | 266 |
|
267 | | - # If place is an sf/sfc polygon or bbox, use it as boundary |
268 | | - if (is.null(boundary) && (inherits(place, "bbox") || (inherits(place, c("sf", "sfc")) && sf::st_dimension(place) == 2))) { |
269 | | - message("Setting boundary = place to geographically subset the output.") |
270 | | - message("Use boundary = NULL to import full extract.") |
271 | | - boundary = place |
| 267 | + # If place is an sf/sfc polygon or bbox, use it as boundary. See also #313 and |
| 268 | + # #314.The following !identical(x, NA) is required since is.na(NULL) returns |
| 269 | + # logical(0) |
| 270 | + if (!identical(boundary, NA)) { |
| 271 | + if ( |
| 272 | + is.null(boundary) && ( |
| 273 | + inherits(place, "bbox") || |
| 274 | + (inherits(place, c("sf", "sfc")) && sf::st_dimension(place) == 2) # The last test checks for POLYGON / MULTIPOLYGON |
| 275 | + ) |
| 276 | + ) { |
| 277 | + oe_message( |
| 278 | + "Setting boundary = place to geographically subset the output. Use boundary = NA to import full extract.", |
| 279 | + quiet = quiet |
| 280 | + ) |
| 281 | + boundary = place |
| 282 | + } |
272 | 283 | } |
273 | 284 |
|
274 | 285 | oe_read( |
|
0 commit comments