JuliaGeo / GeoJSON.jl

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

geo2dict replacement function #47

Open NiharikaPatel opened 1 year ago

NiharikaPatel commented 1 year ago

Hello,

The older version of the package had a geo2dict function to convert the continents json into a dictionary. What is the alternative way to doing that with the new updates to the package ?

GeoJSON.read(read(joinpath(@__DIR__,"..","data","continents","continents.json")))
 conts = geo2dict(continents)
 coords = conts["features"][id]["geometry"]["coordinates"]

Thanks

rafaqz commented 1 year ago

It's always better to include a link to the file you are using so we can demonstrate the fix on your own data (please post if you can)

But maybe you can just do conts[i].geometry.coordinates in your case.

Maybe also explain why you need this as a Dict? Just to make it easier to explore?