Enum osmgraphing::network::StreetCategory
source · [−]pub enum StreetCategory {
Show 19 variants
Motorway,
MotorwayLink,
Trunk,
TrunkLink,
Primary,
PrimaryLink,
Secondary,
SecondaryLink,
Tertiary,
TertiaryLink,
Unclassified,
Residential,
LivingStreet,
Service,
Track,
Road,
Cycleway,
Pedestrian,
Path,
}
Expand description
The street-type, collecting all kind of default-values.
Street-types
Every edge will have a street-type with respective default speed-limit. See osm-wiki Key:highway for details and descriptions.
Accepted tags are listed below (sorted by descending priority) with respective default values. International equivalents are depicted here and shortened/extended below.
(*)
means the street type is allowed or possible but uncomfortable or unusual.
street-type | Respective rural roads in Germany | Respective urban roads in Germany | default speed limit in km/h | for vehicles | for bicycles | for pedestrians |
---|---|---|---|---|---|---|
Motorway | “Autobahn” | “Autobahn” | 130 | yes | no | no |
MotorwayLink | 50 | yes | no | no | ||
Trunk | “Schnellstraße” | “Schnellstraße” | 100 | yes | no | no |
TrunkLink | 50 | yes | no | no | ||
Primary | “Bundesstraße” (national roads) | Highest-level streets | 100 | yes | yes(*) | no |
PrimaryLink | 30 | yes | yes(*) | no | ||
Secondary | “Landesstraße” (regional roads) | Major streets | 70 | yes | yes(*) | no |
SecondaryLink | 30 | yes | yes(*) | no | ||
Tertiary | “Kreisstraße” (local roads) | Streets providing access to suburbs with priority | 70 | yes | yes | no |
TertiaryLink | 30 | yes | yes | no | ||
Unclassified | Streets connecting towns | Industrial areas and providing access to neighborhoods without priority | 50 | yes | yes | no |
Residential | Roads to access houses | 50 | yes | yes | yes | |
LivingStreet | Pedestrians have right over cars | 15 | yes | yes | yes | |
Service | Roads to something (e.g. a park) | 20 | yes(*) | yes | yes | |
Track | Roads mostly used for agricultural- or forestry-uses | Roads mostly used for agricultural- or forestry-uses | 30 | yes(*) | yes(*) | yes |
Road | Undefined roads | Undefined roads | 50 | yes(*) | yes(*) | yes(*) |
Cycleway | For cycles | For cycles | 25 | no | yes | no |
Pedestrian | Mainly for pedestrians | Mainly for pedestrians | 5 | no | yes(*) | yes |
Path | Non-specific path, e.g. for walkers | Non-specific path, e.g. for walkers | 15 | no | yes(*) | yes |
The mapping of given key:value
-pairs to above street-types is too verbose to maintain it here in addition to the code.
Unknown snippets are printed with a warning and their respective id.
Speed-limit
The speed-limit is used in km/h
, which is the provided unit by osm.
Default: See table above
Distance
The distance is used in km
, which is the provided unit by osm.
Default: Calculated by coordinates of involved nodes.
Tag oneway
This tag seems to be very creative. For defaults, see code.
Variants
Motorway
MotorwayLink
Trunk
TrunkLink
Primary
PrimaryLink
Secondary
SecondaryLink
Tertiary
TertiaryLink
Unclassified
Residential
LivingStreet
Service
Track
Road
Cycleway
Pedestrian
Path
Implementations
sourceimpl StreetCategory
impl StreetCategory
pub fn is_for(
&self,
vehicle_category: &VehicleCategory,
is_driver_picky: bool
) -> bool
pub fn from(way: &Way) -> Option<StreetCategory>
pub fn parse_lane_count(&self, _way: &Way) -> u8
pub fn parse_maxspeed(&self, way: &Way) -> KilometersPerHour
sourcepub fn parse_oneway(&self, way: &Way) -> (bool, bool)
pub fn parse_oneway(&self, way: &Way) -> (bool, bool)
return (is_oneway, is_reverse)
Trait Implementations
sourceimpl Display for StreetCategory
impl Display for StreetCategory
Auto Trait Implementations
impl RefUnwindSafe for StreetCategory
impl Send for StreetCategory
impl Sync for StreetCategory
impl Unpin for StreetCategory
impl UnwindSafe for StreetCategory
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.