@@ -37,20 +37,20 @@ struct Args {
37
37
lrm_tag : String ,
38
38
}
39
39
40
- // When sortir the edges, we test each candidate to see if they match and if they need to bee reversed
40
+ // When sorting the edges, each candidate is tested to see if they match and if they need to be reversed.
41
41
#[ derive( PartialEq , Eq , Debug ) ]
42
42
enum Candidate {
43
43
Source ,
44
44
Target ,
45
45
NotCandidate ,
46
46
}
47
47
48
- // If we have a string of edges that ends with `end_edge`
49
- // Can the candidate Edge(s, t) be joined at the end_edge(source, target)
50
- // Returns Forward if the Edge’s can be appened in the same direction (target == s)
51
- // Backward if it must be reverded (target == t)
52
- // And NotCandidate if it can’t be appended
53
- // consider_source means that we consider the source (or target if false) of the last_edge
48
+ // If we have a string of edges that ends with `end_edge`,
49
+ // the candidate ` Edge(s, t)` can be joined at the ` end_edge(source, target)`.
50
+ // Returns Forward if the ` Edge` can be append in the same direction ` (target == s)`,
51
+ // Backward if it must be reversed ` (target == t)` or
52
+ // And NotCandidate if it can’t be appended.
53
+ // ` consider_source` means that the source (or target if false) of the ` last_edge` is considered.
54
54
fn can_be_appended ( candidate : & Edge , last_edge : & Edge , consider_source : bool ) -> Candidate {
55
55
let last_node = if consider_source {
56
56
last_edge. source
@@ -137,6 +137,9 @@ fn sort_edges(edges: Vec<Edge>, traversal_ref: &str) -> Vec<(Edge, bool)> {
137
137
return sorted;
138
138
}
139
139
140
+ /// Example: to generate an LRS from an OpenStreetMap dump
141
+ ///
142
+ /// `$ cargo run --release --bin geometry_from_osm -- -i france.osm.pbf -o osm_83000.lrs.bin --lrm-tag=ref:fr:SNCF_Reseau`
140
143
fn main ( ) {
141
144
let cli_args = Args :: parse ( ) ;
142
145
let ( nodes, edges) = read_osm ( & cli_args. input_osm_file , & cli_args. lrm_tag ) ;
0 commit comments