We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b4a288 commit 6a92e41Copy full SHA for 6a92e41
src/rastergraphs.jl
@@ -396,7 +396,16 @@ function make_raster_graph(
396
397
sources = Vector{Int64}()
398
destinations = Vector{Int64}()
399
- weighted && (node_weights = Vector{Float64}())
+
400
+ weighted && (weight_type = eltype(raster))
401
402
+ if weighted && (weight_type <: Integer)
403
+ @info ("weight_raster eltype is $(weight_type). " *
404
+ "Promoting to Float64.")
405
+ weight_type = Float64
406
+ end
407
408
+ weighted && (node_weights = Vector{weight_type}())
409
410
# Add the edges
411
# Only need to do neighbors down or to the right for undirected graphs
0 commit comments