yeesian / ArchGDAL.jl

A high level API for GDAL - Geospatial Data Abstraction Library
https://yeesian.github.io/ArchGDAL.jl/stable/
Other
137 stars 25 forks source link

Can't convert from JSON3 Array (createpolygon should allow for AbstractVector) #361

Open evetion opened 1 year ago

evetion commented 1 year ago
using ArchGDAL
using GeoJSON
using GeoInterface
g = GeoJSON.read("""
     {
         "type": "Polygon",
         "coordinates": [
             [
                 [100.0, 0.0],
                 [101.0, 0.0],
                 [101.0, 1.0],
                 [100.0, 1.0],
                 [100.0, 0.0]
             ]
         ]
     }""")
GeoInterface.convert(ArchGDAL.IGeometry, g)

MethodError: no method matching createpolygon(::Vector{JSON3.Array}) Closest candidates are: createpolygon() at ~/.julia/packages/ArchGDAL/pPZyn/src/ogr/geometry.jl:1713 createpolygon(::Val) at ~/.julia/packages/ArchGDAL/pPZyn/src/ogr/geometry.jl:1715 createpolygon(::Vector{<:Real}, ::Vector{<:Real}) at ~/.julia/packages/ArchGDAL/pPZyn/src/ogr/geometry.jl:1756 ...

evetion commented 1 year ago

See https://github.com/JuliaGeo/GeoJSON.jl/issues/51