Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polylines in plot_map from samples #41

Open
mcamachom opened this issue May 26, 2021 · 0 comments
Open

Polylines in plot_map from samples #41

mcamachom opened this issue May 26, 2021 · 0 comments

Comments

@mcamachom
Copy link

mcamachom commented May 26, 2021

The function plot_map included in samples, does not take into account roadways defined with polylines, so, tile streets do not match the plotted ones. I have substituted this part:

for e in edges(m,g)
info = "Edge from: $(e.src) to $(e.dst)<br>[information from the <pre>.e</pre> and <pre>.w</pre> fields] "
flm.PolyLine(  (latlon(m,e.src), latlon(m,e.dst)), color="brown", weight=4, opacity=1).add_to(m_plot)
end

by this:

for e in m.roadways
    puntos=[]
    for i in 1:size(e.nodes,1)
        lla=LLA(m.nodes[e.nodes[i]],m.bounds)
        append!(puntos, [(lla.lat, lla.lon)])
    end
info = "Edge $(e)\n<br>[information from the <pre>.e</pre> and <pre>.w</pre> fields] "
    flm.PolyLine(  puntos, color="blue", popup=info, weight=4, opacity=1).add_to(m_plot)
end

and now it seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant