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

Fix placement tag processing #128

Closed
2 tasks done
enzet opened this issue Apr 21, 2022 · 0 comments
Closed
2 tasks done

Fix placement tag processing #128

enzet opened this issue Apr 21, 2022 · 0 comments
Assignees
Labels
bug Something that went wrong generator Map generation issues
Milestone

Comments

@enzet
Copy link
Owner

enzet commented Apr 21, 2022

  • Check whether the lanes tag is specified.
  • Add more tests for placement tag.

Reported by @Zero3 in #83:

This feature crashes map-machine when processing ways that are tagged with placement but not lanes (which is the case for ~3.000 ways according to the overpass turbo query way["placement"][!"lanes"]).

I think map-machine should handle that situation gracefully instead :).

Stack trace:

  File "C:\Users\Zero3\AppData\Roaming\Python\Python38\Scripts\map-machine-script.py", line 33, in <module>
    sys.exit(load_entry_point('map-machine==0.1.3', 'console_scripts', 'map-machine')())
  File "C:\Users\Zero3\AppData\Roaming\Python\Python38\site-packages\map_machine\main.py", line 32, in main
    mapper.render_map(arguments)
  File "C:\Users\Zero3\AppData\Roaming\Python\Python38\site-packages\map_machine\mapper.py", line 311, in render_map
    constructor.construct()
  File "C:\Users\Zero3\AppData\Roaming\Python\Python38\site-packages\map_machine\constructor.py", line 205, in construct
    self.construct_ways()
  File "C:\Users\Zero3\AppData\Roaming\Python\Python38\site-packages\map_machine\constructor.py", line 214, in construct_ways
    self.construct_line(way, [], [way.nodes])
  File "C:\Users\Zero3\AppData\Roaming\Python\Python38\site-packages\map_machine\constructor.py", line 273, in construct_line
    road: Road = Road(
  File "C:\Users\Zero3\AppData\Roaming\Python\Python38\site-packages\map_machine\feature\road.py", line 455, in __init__
    self.placement_offset += self.lanes[lane_number].get_width(
IndexError: list index out of range
@enzet enzet added bug Something that went wrong generator Map generation issues labels Apr 21, 2022
@enzet enzet added this to the 0.2 milestone Apr 21, 2022
@enzet enzet self-assigned this Apr 21, 2022
enzet added a commit that referenced this issue Jun 6, 2022
enzet added a commit that referenced this issue Jun 6, 2022
If `lanes` tag is not specified or specified incorrectly, number of
lanes should be adjusted to fit `placement` tag values.
@enzet enzet closed this as completed Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that went wrong generator Map generation issues
Projects
Status: Done
Development

No branches or pull requests

1 participant