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

How to fix ValueError: not enough values to unpack (expected 2, got 0) in bb #48

Open
douding-lhy opened this issue Jun 29, 2023 · 0 comments

Comments

@douding-lhy
Copy link

This is my code and I want to visualize the gpx data for testing.

`from leuvenmapmatching.util.gpx import gpx_to_path
from leuvenmapmatching.matcher.distance import DistanceMatcher
from leuvenmapmatching.map.inmem import InMemMap
from leuvenmapmatching import visualization as mmviz

map_con = InMemMap("mymap", use_latlon=False)

track = gpx_to_path("route.gpx")
matcher = DistanceMatcher(map_con,
max_dist=100, max_dist_init=25, # meter
min_prob_norm=0.001,
non_emitting_length_factor=0.75,
obs_noise=50, obs_noise_ne=75, # meter
dist_noise=50, # meter
non_emitting_states=True,
max_lattice_width=5)
states, lastidx = matcher.match(track)

mmviz.plot_map(map_con, matcher=matcher,
use_osm=True, zoom_path=True,
show_labels=False, show_matching=True, show_graph=False,
filename="my_osm_plot.png")`

However, the following error appear.

Traceback (most recent call last):
File "C:\Users\Jason...\Data_prep\MapMatching.py", line 20, in
mmviz.plot_map(map_con, matcher=matcher,
File "C:\Users\Jason...\Data_prep\venv\Lib\site-packages\leuvenmapmatching\visualization.py", line 62, in plot_map
bb = map_con.bb()
^^^^^^^^^^^^
File "C:\Users\Jason...\Data_prep\venv\Lib\site-packages\leuvenmapmatching\map\inmem.py", line 187, in bb
glat, glon = zip(*[t[0] for t in self.graph.values()])
^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 0)

Please, I wanna know how to fix it.

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