JuliaGeo / GeoJSON.jl

Utilities for working with GeoJSON data in Julia
https://juliageo.org/GeoJSON.jl/stable/
MIT License
67 stars 10 forks source link

Geometry coordinates aren't parsed as the same type #52

Closed evetion closed 1 year ago

evetion commented 1 year ago
julia> a = """{"type": "FeatureCollection", "features": [
           {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0.1, 0.0], [1, 0.2], [0.0, 1.0], [0.3, 0.0]]]}}
           ]}"""
julia> poly1 = GeoJSON.read(a)[1].geometry
julia> poly1[1]
4-element JSON3.Array{JSON3.Array, Base.CodeUnits{UInt8, String}, SubArray{UInt64, 1, Vector{UInt64}, Tuple{UnitRange{Int64}}, true}}:
 [0.1, 0.0]
 Union{Float64, Int64}[1, 0.2]
 [0, 1]  # <-- Int64
 [0.3, 0.0]
visr commented 1 year ago

Good to have an issue for this here. It was also discussed here, and I commented on this upstream issue.