Skip to content

Commit daeade3

Browse files
authored
Merge pull request #1535 from GenericMappingTools/fix-nested-clip
Fix a situation when using a nested psclip raised by the change to -R
2 parents 91c3ebd + 8ccd5da commit daeade3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/common_options.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2784,7 +2784,8 @@ function add_opt_module(d::Dict)::Vector{String}
27842784
is_coast = false
27852785
end
27862786
r = r[1:findfirst(" -K", r)[1]]; # Remove the "-K -O >> ..."
2787-
r = replace(r, " -R -J" => "")
2787+
opt_R = scan_opt(r, "-R", true)
2788+
r = replace(r, opt_R * " -J" => "") # Mus fish -R first because now all -R are complete (not just -R)
27882789
r = (is_coast) ? "clip " * r : "clip " * strtok(r)[2] # coast case returns a "clip pscoast ..." string that caller can parse
27892790
else
27902791
!(symb in CTRL.callable) && error("Nested Fun call $symb not in the callable nested functions list")

src/pscoast.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,6 @@ function earthregions(name::String=""; proj="guess", grid::Bool=false, dataset="
416416
isempty(D2) && (gmtwhich(fname, G=:a); D2 = gmtwhich(fname, V=:q)) # If not, download it
417417
return grdcut(D2.text[1]::String, R=lim)::GMTimage # This grdcut call will lower to use gdaltranslate
418418
end
419-
gmt("grdcut @"*dataset * res * regist * opt_J * " -R" * lim)::GMTgrid
419+
gmt("grdcut @"*dataset * res * regist * opt_J * " -R" * lim * " -Vq")::GMTgrid
420420
end
421421
end

0 commit comments

Comments
 (0)