pszufe / OpenStreetMapX.jl

OpenStreetMap (*.osm) support for Julia 1.0 and up
MIT License
123 stars 24 forks source link

MethodError: no method matching nv(::Graphs.SimpleGraphs.SimpleDiGraph{Int64}) #62

Open ghost opened 2 years ago

ghost commented 2 years ago

Hi! When I ran the https://pszufe.github.io/OpenStreetMapX_Tutorial/JuliaCon2020/ , the part that took 10 cars an let them drive between randomly selected pairs of points, gives the following error. I installed all the required packages though.

image

pszufe commented 2 years ago

Hi, LightGraphs.jl is no longer maintained and has been replaced by Graphs.jl. Hence all you need to do is to replace the line:

using LightGraphs

with

using Graphs

After the change restart Julia in the Jupyter so you do not have the name clash.

Let me know if it works after the replacement.

ghost commented 2 years ago

@pszufe Thanks! that one resolved, however, later it gives error regarding plotting image

pszufe commented 2 years ago

Change:

ns = LightGraphs.neighbors(s.m.g, agent.current_node)

to

ns = Graphs.neighbors(s.m.g, agent.current_node)
ghost commented 2 years ago

Perfect! So, all the codes are the same, and just need to change the older LightGraphs to Graphs. Is there any comprehensive documentation for using OpenStreetMapX.jl in addition to STABLE one. These are a bit brief.

Thanks again!

pszufe commented 2 years ago

Yes they are unfortunately brief - we look for volunteers here!

For time being have a look https://openstreetmapjl.readthedocs.io/en/stable/ This is the project that OpenStreetMapX.jl took most of the code (and most of it has been rewritten and extended later). Everything that used to work in OpenStreetMap.jl will also work with OpenStreetMapX.jl maybe with slight naming changes.

ghost commented 2 years ago

Thanks a lot @pszufe for your help. If I gain expertise I'll be happy to extend it.