Skip to content

Commit

Permalink
remove lock arg
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Oct 9, 2023
1 parent 28406e6 commit 5b11bfe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ext/RastersArchGDALExt/warp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ end

function _warp(A::AbstractRaster, flags::Dict; filename=nothing, suffix="", kw...)
filename = RA._maybe_add_suffix(filename, suffix)
flagvect = reduce([flags...]; init=[]) do acc, (key, val)
flagvect = reduce([flags...]; init=String[]) do acc, (key, val)
append!(acc, String[_asflag(key), _stringvect(val)...])
end
tempfile = isnothing(filename) ? nothing : tempname() * ".tif"
Expand All @@ -84,7 +84,7 @@ function _warp(A::AbstractRaster, flags::Dict; filename=nothing, suffix="", kw..
# Either read the MEM dataset, or get the filename as a FileArray
# And permute the dimensions back to what they were in A
p_raster = _maybe_permute_from_gdal(raster, dims(A))
# Either read the MEM dataset to an Array, or keep a filename base raster lazy
# Either read the MEM dataset to an Array, or keep the raster lazy
return isnothing(filename) ? read(p_raster) : p_raster
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/methods/burning/point.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ end
_fill_index!(x, fill, I)
else
sector = CartesianIndices(map(i -> i:i, I))
Base.lock(lock, sector)
Base.lock(lock)
_fill_index!(x, fill, I)
Base.unlock(lock)
end
Expand Down
4 changes: 2 additions & 2 deletions src/methods/rasterize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ function _rasterize!(A, ::GI.AbstractGeometryTrait, geom, fill, r::Rasterizer; a
hasburned = any(bools)
if hasburned
# Avoid race conditions
isnothing(lock) || Base.lock(lock, V)
isnothing(lock) || Base.lock(lock)
_fill!(V, bools, fill, op, init, missingval)
isnothing(lock) || Base.unlock(lock)
end
Expand All @@ -584,7 +584,7 @@ end
# Fill points
function _rasterize!(A, trait::GI.AbstractPointTrait, point, fill, r::Rasterizer; allocs=nothing)
# Avoid race conditions whern Point is in a mixed set of Geometries
isnothing(r.lock) || Base.lock(r.lock, A)
isnothing(r.lock) || Base.lock(r.lock)
hasburned = _fill_point!(A, trait, point; fill, r.lock)
isnothing(r.lock) || Base.unlock(r.lock)
# for all points we avoid parallel rasterization completely - this method should not be hit often
Expand Down

0 comments on commit 5b11bfe

Please sign in to comment.