Struct valhalla_client::Location
source · pub struct Location {Show 19 fields
pub latitude: f64,
pub longitude: f64,
pub street: Option<String>,
pub way_id: Option<i64>,
pub minimum_reachability: Option<i32>,
pub radius: Option<i32>,
pub rank_candidates: Option<bool>,
pub preferred_side: Option<Side>,
pub type_: LocationType,
pub heading: Option<String>,
pub heading_tolerance: Option<String>,
pub name: Option<String>,
pub display_lat: Option<f64>,
pub display_lon: Option<f64>,
pub search_cutoff: Option<f64>,
pub node_snap_tolerance: Option<f64>,
pub street_side_tolerance: Option<f64>,
pub street_side_max_distance: Option<f64>,
pub street_side_cutoff: Option<f64>,
}
Fields§
§latitude: f64
Latitude of the location in degrees. This is assumed to be both the routing location and the display location if no display_lat and display_lon are provided.
longitude: f64
Longitude of the location in degrees. This is assumed to be both the routing location and the display location if no display_lat and display_lon are provided.
street: Option<String>
(optional) Street name. The street name may be used to assist finding the correct routing location at the specified latitude, longitude. This is not currently implemented.
way_id: Option<i64>
(optional) OpenStreetMap identification number for a polyline way. The way ID may be used to assist finding the correct routing location at the specified latitude, longitude. This is not currently implemented.
minimum_reachability: Option<i32>
Minimum number of nodes (intersections) reachable for a given edge (road between intersections) to consider that edge as belonging to a connected region. When correlating this location to the route network, try to find candidates who are reachable from this many or more nodes (intersections). If a given candidate edge reaches less than this number of nodes its considered to be a disconnected island and we’ll search for more candidates until we find at least one that isn’t considered a disconnected island. If this value is larger than the configured service limit it will be clamped to that limit. The default is a minimum of 50 reachable nodes.
radius: Option<i32>
The number of meters about this input location within which edges (roads between intersections) will be considered as candidates for said location. When correlating this location to the route network, try to only return results within this distance (meters) from this location. If there are no candidates within this distance it will return the closest candidate within reason. If this value is larger than the configured service limit it will be clamped to that limit. The default is 0 meters.
rank_candidates: Option<bool>
Whether or not to rank the edge candidates for this location. The ranking is used as a penalty within the routing algorithm so that some edges will be penalized more heavily than others. If true candidates will be ranked according to their distance from the input and various other attributes. If false the candidates will all be treated as equal which should lead to routes that are just the most optimal path with emphasis about which edges were selected.
preferred_side: Option<Side>
If the location is not offset from the road centerline or is closest to an intersection this option has no effect. Otherwise the determined side of street is used to determine whether or not the location should be visited from the same, opposite or either side of the road with respect to the side of the road the given locale drives on. In Germany (driving on the right side of the road), passing a value of same will only allow you to leave from or arrive at a location such that the location will be on your right. In Australia (driving on the left side of the road), passing a value of same will force the location to be on your left. A value of opposite will enforce arriving/departing from a location on the opposite side of the road from that which you would be driving on while a value of either will make no attempt limit the side of street that is available for the route.
type_: LocationType
Type of location, either break, through, via or break_through. Each type controls two characteristics: whether or not to allow a u-turn at the location and whether or not to generate guidance/legs at the location. A break is a location at which we allows u-turns and generate legs and arrival/departure maneuvers. A through location is a location at which we neither allow u-turns nor generate legs or arrival/departure maneuvers. A via location is a location at which we allow u-turns but do not generate legs or arrival/departure maneuvers. A break_through location is a location at which we do not allow u-turns but do generate legs and arrival/departure maneuvers. If no type is provided, the type is assumed to be a break. The types of the first and last locations are ignored and are treated as breaks.
heading: Option<String>
(optional) Preferred direction of travel for the start from the location. This can be useful for mobile routing where a vehicle is traveling in a specific direction along a road, and the route should start in that direction. The heading is indicated in degrees from north in a clockwise direction, where north is 0°, east is 90°, south is 180°, and west is 270°.
heading_tolerance: Option<String>
(optional) How close in degrees a given street’s angle must be in order for it to be considered as in the same direction of the heading parameter. The default value is 60 degrees.
name: Option<String>
§display_lat: Option<f64>
Latitude of the map location in degrees. If provided the lat and lon parameters will be treated as the routing location and the display_lat and display_lon will be used to determine the side of street. Both display_lat and display_lon must be provided and valid to achieve the desired effect.
display_lon: Option<f64>
Longitude of the map location in degrees. If provided the lat and lon parameters will be treated as the routing location and the display_lat and display_lon will be used to determine the side of street. Both display_lat and display_lon must be provided and valid to achieve the desired effect.
search_cutoff: Option<f64>
The cutoff at which we will assume the input is too far away from civilisation to be worth correlating to the nearest graph elements. The default is 35 km.
node_snap_tolerance: Option<f64>
During edge correlation this is the tolerance used to determine whether or not to snap to the intersection rather than along the street, if the snap location is within this distance from the intersection the intersection is used instead. The default is 5 meters.
street_side_tolerance: Option<f64>
If your input coordinate is less than this tolerance away from the edge centerline then we set your side of street to none otherwise your side of street will be left or right depending on direction of travel. The default is 5 meters.
street_side_max_distance: Option<f64>
The max distance in meters that the input coordinates or display ll can be from the edge centerline for them to be used for determining the side of street. Beyond this distance the side of street is set to none. The default is 1000 meters.
street_side_cutoff: Option<f64>
Disables the preferred_side when set to same or opposite if the edge has a road class less than that provided by street_side_cutoff. The road class must be one of the following strings: motorway, trunk, primary, secondary, tertiary, unclassified, residential, service_other. The default value is service_other so that preferred_side will not be disabled for any edges.