Struct street_index::roads2csv::DeduplicatedRoads [−][src]
pub struct DeduplicatedRoads { pub roads: BTreeMap<StreetName, BTreeSet<GridPosition>>, }
Deduplicates road names, merging the roads by their name
Fields
roads: BTreeMap<StreetName, BTreeSet<GridPosition>>
Methods
impl DeduplicatedRoads
[src]
impl DeduplicatedRoads
pub fn from_streets(streets: &[InputStreetValue]) -> Self
[src]
pub fn from_streets(streets: &[InputStreetValue]) -> Self
Deduplicates road names, i.e.:
Input:
Mayer Street A4 Mayer Street A5 Mayer Street A6
Output:
Mayer Street -> [A4, A5, A6]
The output road name positions are ordered.
pub fn process(&self) -> (ProcessedRoadNames, UnprocessedRoadNames)
[src]
pub fn process(&self) -> (ProcessedRoadNames, UnprocessedRoadNames)
Processes road names ([A1, A2]
=> A1-A2
) if they span less than 2 grids.
Processing road names in a cartographic manner is tricky. For example, a street that appears in two locations on the map (such as a city having the same street name as a neighbouring city). Because of this, street name processing can't be fully automated, since there are always weird edge cases to worry about. However, 90% of roads aren't like that.
Because of this limitation process()
gives you two types of roads back:
ProcessedRoadName
is for roads that span only 1 or 2 grid cells (i.e."Canterbury Road" => A9
,"Canterbury Road" => A9-A10
). In these cases (which cover 90% of street index names), the mapping is not ambigouus.
UnprocessedRoadName
is for anything else (e.g. "Canterbury Road" => [A9, A10, E1, E2]
.
Usually these roads need to be manually reviewed - it could likely be that
there are two roads "Canterbury Road" => A9-10;E1-E2
, but it could also
be that the road is just one road and part of it is just clipped off the map,
in which case you'd write "Canterbury Road" => A9-E2
.
Trait Implementations
impl Debug for DeduplicatedRoads
[src]
impl Debug for DeduplicatedRoads
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for DeduplicatedRoads
[src]
impl Clone for DeduplicatedRoads
fn clone(&self) -> DeduplicatedRoads
[src]
fn clone(&self) -> DeduplicatedRoads
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for DeduplicatedRoads
[src]
impl PartialEq for DeduplicatedRoads
fn eq(&self, other: &DeduplicatedRoads) -> bool
[src]
fn eq(&self, other: &DeduplicatedRoads) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &DeduplicatedRoads) -> bool
[src]
fn ne(&self, other: &DeduplicatedRoads) -> bool
This method tests for !=
.
impl Eq for DeduplicatedRoads
[src]
impl Eq for DeduplicatedRoads
impl PartialOrd for DeduplicatedRoads
[src]
impl PartialOrd for DeduplicatedRoads
fn partial_cmp(&self, other: &DeduplicatedRoads) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &DeduplicatedRoads) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &DeduplicatedRoads) -> bool
[src]
fn lt(&self, other: &DeduplicatedRoads) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &DeduplicatedRoads) -> bool
[src]
fn le(&self, other: &DeduplicatedRoads) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &DeduplicatedRoads) -> bool
[src]
fn gt(&self, other: &DeduplicatedRoads) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &DeduplicatedRoads) -> bool
[src]
fn ge(&self, other: &DeduplicatedRoads) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for DeduplicatedRoads
[src]
impl Ord for DeduplicatedRoads
fn cmp(&self, other: &DeduplicatedRoads) -> Ordering
[src]
fn cmp(&self, other: &DeduplicatedRoads) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for DeduplicatedRoads
[src]
impl Hash for DeduplicatedRoads
Auto Trait Implementations
impl Send for DeduplicatedRoads
impl Send for DeduplicatedRoads
impl Sync for DeduplicatedRoads
impl Sync for DeduplicatedRoads