Skip to content

Commit 2fbdbe6

Browse files
committed
add doc
1 parent 1d86330 commit 2fbdbe6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/geometry_from_osm.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ struct Args {
3737
lrm_tag: String,
3838
}
3939

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.
4141
#[derive(PartialEq, Eq, Debug)]
4242
enum Candidate {
4343
Source,
4444
Target,
4545
NotCandidate,
4646
}
4747

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.
5454
fn can_be_appended(candidate: &Edge, last_edge: &Edge, consider_source: bool) -> Candidate {
5555
let last_node = if consider_source {
5656
last_edge.source
@@ -137,6 +137,9 @@ fn sort_edges(edges: Vec<Edge>, traversal_ref: &str) -> Vec<(Edge, bool)> {
137137
return sorted;
138138
}
139139

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`
140143
fn main() {
141144
let cli_args = Args::parse();
142145
let (nodes, edges) = read_osm(&cli_args.input_osm_file, &cli_args.lrm_tag);

0 commit comments

Comments
 (0)