ITADN

`init` being used in applyreduce when I don't think it should

#353Closedasinghvi17 创建于 2025-10-25
A
asinghvi17commented
```julia using GADM import GeoInterface as GI, GeometryOps as GO texas = GADM.get("USA", "Texas") |> GI.getfeature |> only |> GI.geometry texas_lower = GO.applyreduce(vcat, GO.TraitTarget(GI.AbstractCurveTrait), texas) do geom points = GO.forcexyz(geom, 0.0).geom push!(points, (NaN, NaN, NaN)) return points end ``` ```julia 114424-element Vector{Union{Nothing, Tuple{Float64, Float64, Float64}}}: nothing nothing (-97.27569599999993, 26.237083000000098, 0.0) (-97.27541399999996, 26.237083000000098, 0.0) (-97.27541399999996, 26.236528000000135, 0.0) (-97.27513899999997, 26.236528000000135, 0.0) (-97.27513899999997, 26.235695000000135, 0.0) ⋮ (-97.13500199999987, 28.056389000000024, 0.0) (-97.1347199999999, 28.056667000000118, 0.0) (-97.13444499999997, 28.056667000000118, 0.0) (-97.13416299999989, 28.056944000000158, 0.0) (-97.13333099999988, 28.056944000000158, 0.0) (NaN, NaN, NaN) ``` That returns a vector where the first 2 elements are nothing, the rest are as expected. But it's all a bit odd really. We ought to not put those nothings in. Passing ` init = (NaN, NaN, NaN)` to applyreduce fixes it for now...but this is the kind of thing we should just do without needing init.
关闭于 2026-01-16 2 条评论