Skip to content

Commit

Permalink
Merge pull request #160 from GlobalFishingWatch/develop
Browse files Browse the repository at this point in the history
remove length check for shapefile
  • Loading branch information
AndreaSanchezTapia committed Jul 10, 2024
2 parents 4634076 + 3c7ebff commit 73a4a5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/get_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ if (is.null(region_source)) stop("region_source and region params are required")
region <- rjson::toJSON(list(region = list(dataset = 'public-rfmo',
id = region)))
} else if (region_source == 'USER_JSON') {
if (length(region) > 1) stop("only 1 json region must be provided")
if (methods::is(region, 'sf') & base::class(region$geometry)[1] %in% c("sfc_POLYGON","sfc_MULTIPOLYGON")) {
if (methods::is(region, 'sf') & base::class(region$geometry)[1] %in% c("sfc_POLYGON","sfc_MULTIPOLYGON")
) {
region <- sf_to_geojson(region, endpoint = 'raster')
} else {
stop('custom region is not an sf polygon')
Expand Down

0 comments on commit 73a4a5c

Please sign in to comment.