GithubHelp home page GithubHelp logo

osmmakie.jl's People

Contributors

asinghvi17 avatar datseris avatar fbanning avatar jaakkor2 avatar simsurace avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

osmmakie.jl's Issues

**Edges and vertices**

  • color edges according to way type
  • highlight edge on mouse hover
  • copy corresponding way id on edge click
  • highlight vertex on mouse hover
  • copy corresponding node id on vertex click

Bug: `key "node" not found` when running example code.

Summary

I'm running the example code from the Readme file.
However, in the example downloading and displaying buildings, I am running into an error:

area = (
    minlat = 51.5015, minlon = -0.0921, # bottom left corner
    maxlat = 51.5154, maxlon = -0.0662 # top right corner
)
# download OpenStreetMap buildings data
download_osm_buildings(:bbox;
    area...,
    metadata = true,
    download_format = :osm,
    save_to_file_location = "london_buildings.osm",
);
# load as Buildings Dict
buildings = buildings_from_file("london_buildings.osm");

produces

ERROR: KeyError: key 5461892572 not found
Stacktrace:
 [1] getindex(h::Dict{Int64, Dict{String, Any}}, key::Int64)
   @ Base ./dict.jl:484
 [2] parse_osm_buildings_dict(osm_buildings_dict::Dict{String, Any})
   @ LightOSM ~/.julia/packages/LightOSM/Lf5Q0/src/buildings.jl:215
 [3] buildings_from_object
   @ ~/.julia/packages/LightOSM/Lf5Q0/src/buildings.jl:260 [inlined]
 [4] buildings_from_file(file_path::String)
   @ LightOSM ~/.julia/packages/LightOSM/Lf5Q0/src/buildings.jl:294
 [5] top-level scope
   @ REPL[21]:2

Any insights are appreciated!

Package versions:

julia> Pkg.status.(["LightOSM", "OSMMakie"])
Project OSM_test v0.1.0
Status `~/Documents/julia_playground/OSM_test/Project.toml`
  [d1922b25] LightOSM v0.2.11
Project OSM_test v0.1.0
Status `~/Documents/julia_playground/OSM_test/Project.toml`
  [76b6901f] OSMMakie v0.0.7

Register package

Could you please register the package? It takes several days from submission to registration. Moving to an org after a registration is not a problem.

still some errors

Hi, it doesn't work yet, once again, here is the code I use to test:

using Agents

model, zombie_step!, model_step! = Models.zombies()

using OSMMakie
using GLMakie
ac(agent) = agent.infected ? :green : :black
as(agent) = agent.infected ? 6 : 5
fig = Figure(); display(fig)
ax = Axis(fig[1,1])
osmplot!(ax, model.space.map)
ids = model.scheduler(model)
colors = Observable([ac(model[i]) for i in ids])
sizes = Observable([as(model[i]) for i in ids])
pos = Observable(Point2f[OSM.latlon(model[i].pos, model) for i in ids])
scatter!(ax, pos; color = colors, markersize = sizes)

with Agents master. This code is useful because now the default graph is different. It already highlighted one problem.
In line 41 in recipe.jl you need to write zip(1:Graphs.ne(osm.graph), instead of 1:osm.gra.ne. Not all graphs have a .ne field, but the ne function always returns the number of edges. I was going to do a PR but even after this fix there is another problem:

ERROR: LoadError: KeyError: key :osm_edge_colors not found
Stacktrace:
  [1] getindex(h::Dict{Symbol, Observable}, key::Symbol)
    @ Base .\dict.jl:481
  [2] getindex
    @ C:\Users\datse\.julia\packages\MakieCore\S8PkO\src\attributes.jl:96 [inlined] 
  [3] getindex
    @ C:\Users\datse\.julia\packages\MakieCore\S8PkO\src\attributes.jl:192 [inlined]
  [4] getproperty
    @ C:\Users\datse\.julia\packages\MakieCore\S8PkO\src\attributes.jl:83 [inlined] 
  [5] set_edge_defaults(osmplot::Combined{OSMMakie.osmplot, Tuple{LightOSM.OSMGraph{Int32, Int64, Float64}}})
    @ OSMMakie C:\Users\datse\.julia\dev\OSMMakie\src\defaults.jl:45
  [6] plot!(osmplot::Combined{OSMMakie.osmplot, Tuple{LightOSM.OSMGraph{Int32, Int64, Float64}}})   
    @ OSMMakie C:\Users\datse\.julia\dev\OSMMakie\src\recipe.jl:55
  [7] plot!(scene::Scene, P::Type{Combined{OSMMakie.osmplot, Tuple{LightOSM.OSMGraph{Int32, Int64, Float64}}}}, attributes::Attributes, input::Tuple{Observable{LightOSM.OSMGraph{Int32, Int64, Float64}}}, args::Observable{Tuple{LightOSM.OSMGraph{Int32, Int64, Float64}}})

Indeed, looking at the definition of Attributes at lline 23, there isn't any attribute with that name. I'm not sure how to fix this part as I've never learned the Makie recipe system yet.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

**Labels**

  • scale elabels_textsize according to zoom level and/or edge length
  • observe state of hide_elabels and hide_nlabels and dynamically change plot
  • fix elabels for duplicate ways (i.e. reduce label overlap)
  • look into further performance improvements when there are a lot of elabels

ERROR: LoadError: Buffer position does not have the same length as the other buffers

I get error:

ERROR: LoadError: Buffer position does not have the same length as the other buffers.
        offset has length 2411
        position has length 1483
        scale has length 241

on running the script (requires Agents#master):

using Agents

model, zombie_step!, model_step! = Models.zombies()

using OSMMakie
using GLMakie
ac(agent) = agent.infected ? :green : :black
as(agent) = agent.infected ? 6 : 5

fig, ax, plot = osmplot(model.space.map)
display(fig)

The only reason for me to use Agents is to get the map of Geottingen. Since you have not encountered this issue so far, that's why I'm explicitly using Agents, so that we get the map that has the problem.

Don't know if its a problem with map or some assumption of hte plotting library.

cc @fbanning , @ AayushSabharwal

How to change light yellow color of some streets?

image

This light yellow color is barely visible so I'd like to change it for InteractiveDynamics.jl. I am not sure how to do that though. I had a look at the source code, and I believe I need to provide something to graphplotkwargs, but I am not sure what... What kind of street is the one that has this light yellow color...?

Need `InteractiveUtils` in Project.toml

Just a typicallity:

┌ Warning: Package OSMMakie does not have InteractiveUtils in its dependencies:
│ - If you have OSMMakie checked out for development and have
│   added InteractiveUtils as a dependency but haven't updated your primary
│   environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with OSMMakie
└ Loading InteractiveUtils into OSMMakie from project dependency, future warnings for OSMMakie are suppressed.
WARNING: Method definition registration_setup!(Any, GraphMakie.GraphInteraction) in module GraphMakie at C:\Users\datse\.julia\packages\GraphMakie\tEQ8U\src\interaction.jl:45 overwritten in module OSMMakie at C:\Users\datse\.julia\dev\OSMMakie\src\interaction.jl:6.
  ** incremental compilation may be fatally broken for this module **

Standard library packages still need to be added to project.toml

Add theming support

Yeah, sorry I wasn't clear. It may be convenient to allow the user to pass a dictionary to osmplot! (or to propagate keyword arguments) so that the user can decide the color of the street types instead of the individual edges.
Originally posted by @Datseris in #8 (comment)

We have a pretty basic default theme in src/defaults. In default_consts.jl we for example define some dictionaries for colours, widths, and styles of edges depending on their way type ("motorway", "pedestrian", ...). These attributes are then used in defaults.jl for construction of the related edge attributes.

It would be very nice to implement some kind of basic theming support for users to change the colourscheme, widths, etc.
There might be two possible ways to do this:

  • Stick to current approach. Users can provide dictionaries of which values to change with fallbacks to default theme. This is easy to do with the current way to theme the plot and can be done as a first step.
  • Completely switch to using a Makie theme so that users can use Makie.set_theme! or Makie.with_theme. This is a more fundamental change and will require some research into Makie themes. I'm not sure if it provides all the detailed layers of theming that we require.

Use waypoints for smoother ways

Currently all roads are comprised of multiple "unconnected" linesegments which just happen to end at the same position at which another linesegment starts. This leads to precise display of street corners and such. But this precision doesn't look so nice when there are sharp bends in a road and leads to whitespace which reveals that the linesegments aren't connected to each other.

GraphMakie provides the ability to pass waypoints to plot an edge, see https://juliaplots.org/GraphMakie.jl/stable/generated/plots/#Edge-waypoints . Using this functionality with a small r value could lead to nicer looking roads/edges with the underlying data on how their nodes are interconnected.

Less harsh defaults for plots

Current defaults look like this:

image

I think it would be nice to use a less harsh color for larger roads instead of this thick black. Some reds, oranges, and yellows will make a for a more pleasant map maybe?

e.g.,

image

(p.s.: it is not clear from the docs how to change these defaults via keywords to osmplot!)

How to remove directional triangles from streets?

At the moment streets are plotted with white triagnles that show direction:

image

However for large maps this is not a useful feature as it strongly decreases visibility, and the road widths remain the same under zoom meaning that even if I zoom in the plot I still can't really tell apart which direction the triangles point.

I'd like to disable the triangles. How can I do that? Can we add a simple keyword argument to the plot function?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.