Skip to content

Commit

Permalink
no spaces in layerid; stop if fgb file doesn't exists.
Browse files Browse the repository at this point in the history
closes r-spatial/mapview#308 and addresses #24
  • Loading branch information
tim-salabim committed Jul 10, 2020
1 parent 04a145a commit b9c4114
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/file.R
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,18 @@ addFgb = function(map,

if (is.null(layerId)) layerId = group
layerId = gsub("\\.", "_", layerId)
layerId = gsub(" ", "", layerId)

if (!is.null(file)) {
if (!file.exists(file)) {
stop(
sprintf(
"file %s does not seem to exist"
, file
)
, call. = FALSE
)
}
path_layer = tempfile()
dir.create(path_layer)
path_layer = paste0(path_layer, "/", layerId, "_layer.fgb")
Expand Down

0 comments on commit b9c4114

Please sign in to comment.