Closed bovine3dom closed 3 years ago
julia> o = ogr2ogr(
shapefile,
flags = Dict(
"f" => "geojson",
"t_srs" => "epsg:4326",
"s_srs" => "epsg:27700",
)
);
julia> GeoJSON.read(o)
ERROR: MethodError: no method matching read(::Array{UInt8,1})
Closest candidates are:
read(::IOStream) at iostream.jl:488
read(::IOStream, ::Type{UInt8}) at iostream.jl:383
read(::IOStream, ::Union{Type{Int16}, Type{Int32}, Type{Int64}, Type{UInt16}, Type{UInt32}, Typ
e{UInt64}}) at iostream.jl:392
...
Stacktrace:
[1] top-level scope at REPL[15]:1
julia> read("blah.geojson")
3-element Array{UInt8,1}:
0x7b
0x7d
0x0a
julia> GeoJSON.read(read("blah.geojson"))
ERROR: MethodError: no method matching read(::Array{UInt8,1})
Closest candidates are:
read(::IOStream) at iostream.jl:488
read(::IOStream, ::Type{UInt8}) at iostream.jl:383
read(::IOStream, ::Union{Type{Int16}, Type{Int32}, Type{Int64}, Type{UInt16}, Type{UInt32}, Typ
e{UInt64}}) at iostream.jl:392
...
Stacktrace:
[1] top-level scope at REPL[19]:1
Somehow something that worked a few days ago is no longer working
I'm jolly confused.
Edit: comment where it was working - https://github.com/cmcaine/od-vis/pull/1#discussion_r568584421 - I'm wondering if we're using an ancient version of GeoJSON
Edit2: yeah, looks like GeoJSON is stuck at version 0.4.0
where the version in od-vis is 0.5.1
. Haven't worked out what is forcing it to stay on the previous version
Edit3:
(backend) pkg> add GeoJSON@0.5.1
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package GeoJSON [61d90e0f]:
GeoJSON [61d90e0f] log:
├─possible versions are: [0.4.0, 0.5.0-0.5.1] or uninstalled
├─restricted to versions 0.4 by Turf [e89237b0], leaving only versions 0.4.0
│ └─Turf [e89237b0] log:
│ ├─possible versions are: 0.2.0 or uninstalled
│ └─Turf [e89237b0] is fixed to version 0.2.0
└─restricted to versions 0.5.1 by an explicit requirement — no versions left
Seems to work now.
I commented out some broken tests in Turf.jl
, but they were broken before I stopped it from depending on exact versions of things.
Untested.
Should extract this function to a non-PCT specific file and switch to
/vsistdout/
to avoid the interim geojson being generated on disk.