Skip to content

Commit 81af6c6

Browse files
authored
bugfix JET.jl errors (#324)
1 parent bd479c5 commit 81af6c6

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/methods/rasterize.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ end
147147
function _create_rasterize_dest(fill, name, dims;
148148
filename=nothing, missingval=nothing, metadata=NoMetadata(), suffix=nothing, kw...
149149
)
150-
missingval = isnothing(missingval) ? _writeable_missing(filename, typeof(val)) : missingval
150+
missingval = isnothing(missingval) ? _writeable_missing(filename, typeof(fill)) : missingval
151151
A = _alloc_rasterize(filename, typeof(fill), dims; name, metadata, missingval, suffix) do a
152152
a .= missingval
153153
end
@@ -253,7 +253,6 @@ function _rasterize!(x, ::GI.AbstractFeatureCollectionTrait, fc; fill, kw...)
253253
return x
254254
end
255255
function _rasterize!(x, ::GI.AbstractFeatureTrait, feature; fill, kw...)
256-
# TODO test this branch
257256
rasterize!(x, GI.geometry(feature); fill=_featurefillval(feature, fill), kw...)
258257
end
259258
function _rasterize!(x, ::GI.AbstractGeometryTrait, geom; fill, _buffer=nothing, kw...)

src/polygon_ops.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,14 @@ function _extent(::Nothing, data)
370370
else
371371
# TODO: test this branch
372372
# Table of points with dimension columns
373-
reduce(DEFAULT_TABLE_DIM_KEYS; init=(;)) do acc, key
373+
data = reduce(DEFAULT_TABLE_DIM_KEYS; init=(;)) do acc, key
374374
if key in Tables.columnnames(cols)
375375
merge(acc, (; key=extrema(cols[key])))
376376
else
377377
acc
378378
end
379379
end
380+
return Extent(data)
380381
end
381382
else
382383
return Extents.extent(data)
@@ -408,7 +409,7 @@ function extent_may_intersect(x, geom)
408409
# TODO: this is not actually used.
409410
rasterextent = Extents.extent(x, DEFAULT_POINT_ORDER)
410411
geomextent = GI.extent(geom)
411-
if isnothing(rasterextent) || isnothing(geomextent)
412+
if isnothing(geomextent)
412413
return true
413414
else
414415
return Extents.intersects(geomextent, rasterextent)

src/sources/gdal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ function _gdalmetadata(dataset::AG.Dataset, key)
417417
regex = Regex("$key=(.*)")
418418
i = findfirst(f -> occursin(regex, f), meta)
419419
if i isa Nothing
420-
return nothing
420+
return ""
421421
else
422422
return match(regex, meta[i])[1]
423423
end

src/stack.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ function RasterStack(filenames::NamedTuple{K,<:Tuple{<:AbstractString,Vararg}};
191191
end
192192
# Multi Raster stack from Tuple of AbstractArray
193193
function RasterStack(data::Tuple{Vararg{<:AbstractArray}}, dims::Tuple; name=nothing, keys=name, kw...)
194+
isnothing(keys) && throw(ArgumentError("`name` or `keys` keyword must be a tuple of `Symbol`"))
194195
return RasterStack(NamedTuple{cleankeys(keys)}(data), dims; kw...)
195196
end
196197
# Multi Raster stack from NamedTuple of AbstractArray

0 commit comments

Comments
 (0)