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

Crash on loading Lyon Map on 0.3.38 #1051

Closed
XaranDeBruregor opened this issue Jan 26, 2023 · 8 comments
Closed

Crash on loading Lyon Map on 0.3.38 #1051

XaranDeBruregor opened this issue Jan 26, 2023 · 8 comments

Comments

@XaranDeBruregor
Copy link

Hello !

The windows application version 0.3.38 crashed when I load Lyon's map on LTN.

Also tried on the web application :
image

@Transurgeon
Copy link
Contributor

I am taking a look into this.

image

The reason could be because the euclidian distance is calculated instead of the haversine distance which leads to these two specific points to be too close to each other (in the line constructor, the distance must be greater than epsilon which is defined as 0.01 meters).

However, I still think these points would be too close. Could we somehow delete one of the two points?

@dabreegster
Copy link
Collaborator

The raw_dist_to comment was old and misleading; Pt2Ds are fine to use Euclidean distance: https://a-b-street.github.io/docs//tech/map/details.html#coordinate-system

Running with RUST_BACKTRACE=1, more of the error is:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Line from Pt2D { x: 9868.9908, y: 4474.0891 } t
o Pt2D { x: 9868.994, y: 4474.0986 } too small', geom/src/line.rs:25:29
stack backtrace: 
   0: rust_begin_unwind
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
   2: core::result::unwrap_failed
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1791:5
   3: geom::line::Line::must_new
   4: geom::polyline::PolyLine::dist_along_of_point
   5: geom::ring::Ring::get_both_slices_btwn
   6: geom::ring::Ring::get_slice_between
   7: map_model::objects::block::Perimeter::to_block
   8: ltn::partition::Partitioning::seed_using_heuristics

The most complex part of the LTN tool divides space between main roads and traces around blocks. After new changes in road geometry from osm2streets in this release, that process is hitting some new problem. I have a few ongoing ideas to make the LTN tool not rely on this brittle and complicated "blockfinding" process, and also try to solve problems @XaranDeBruregor has hit where tunnels/bridges cross. For the moment, looks like you should stick to the 0.3.37 release for the LTN tool, sorry.

The info about the new blockfinding idea is unfortunately a bit scattered in a few places, but if anyone's interested:
https://dabreegster.github.io/talks/aiuk_ltn/slides.html#/defining-a-neighborhood-1
#1024
#1044
a-b-street/osm2streets#10
a-b-street/osm2streets#170

It's the most urgent thing on my mind, so trying to make real progress on it

@dabreegster
Copy link
Collaborator

Screenshot from 2023-02-09 11-50-31
I've tried disabling some of the epsilon checks, just to see what's causing trouble over here. I can't even figure out the problem -- it looks completely fine.

Going to start a PR suggesting a pretty radical change to the geom library...

@XaranDeBruregor
Copy link
Author

My small update on the issue. Tested with abstreet_windows_v0_3_39, also not working.
I saw your progress on the subject. That's great work ! Cheers. :D

@dabreegster
Copy link
Collaborator

This particular problem will be fixed in the next release (hopefully next few days), though editing boundaries is still broken in Lyon

@dabreegster
Copy link
Collaborator

http://play.abstreet.org/0.3.40/ltn.html?system/fr/lyon/maps/center.bin
Give 0.3.40 a shot. It at least doesn't crash, but you can't edit boundaries here yet, due to some bizarre still unsolved problem

@dabreegster
Copy link
Collaborator

0.3.41 should also let you edit boundaries in Lyon now, FYI

@XaranDeBruregor
Copy link
Author

Yep I confirm with 0.3.41, boudaries editing is baack !

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

3 participants