Struct h3ron_graph::graph::prepared::PreparedH3EdgeGraph
source · [−]pub struct PreparedH3EdgeGraph<W> { /* private fields */ }Expand description
A prepared graph which can be used with a few algorithms.
Consequent H3DirectedEdges without forks get extended by a LongEdge to allow
skipping the individual H3DirectedEdge values for a more efficient graph
traversal.
Implementations
sourceimpl<W> PreparedH3EdgeGraph<W>
impl<W> PreparedH3EdgeGraph<W>
sourcepub fn count_edges(&self) -> (usize, usize)
pub fn count_edges(&self) -> (usize, usize)
count the number of edges in the graph
The returned tuple is (num_edges, num_long_edges)
sourceimpl<W> PreparedH3EdgeGraph<W>where
W: Copy,
impl<W> PreparedH3EdgeGraph<W>where
W: Copy,
sourcepub fn iter_edges(
&self
) -> impl Iterator<Item = (H3DirectedEdge, EdgeWeight<'_, W>)>
pub fn iter_edges(
&self
) -> impl Iterator<Item = (H3DirectedEdge, EdgeWeight<'_, W>)>
iterate over all edges of the graph
sourcepub fn iter_edges_non_overlapping(
&self
) -> Result<impl Iterator<Item = (H3DirectedEdge, EdgeWeight<'_, W>)>, Error>
pub fn iter_edges_non_overlapping(
&self
) -> Result<impl Iterator<Item = (H3DirectedEdge, EdgeWeight<'_, W>)>, Error>
iterate over all edges of the graph, while skipping simple H3DirectedEdge
which are already covered in other LongEdge instances of the graph.
This function iterates the graph twice - the first time to collect all edges which are part of long-edges.
sourceimpl<W> PreparedH3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy + Ord + Zero + Send + Sync,
impl<W> PreparedH3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy + Ord + Zero + Send + Sync,
pub fn from_h3edge_graph(
graph: H3EdgeGraph<W>,
min_longedge_length: usize
) -> Result<Self, Error>
Trait Implementations
sourceimpl<W> BoundingRect<f64> for PreparedH3EdgeGraph<W>
impl<W> BoundingRect<f64> for PreparedH3EdgeGraph<W>
sourceimpl<W: Clone> Clone for PreparedH3EdgeGraph<W>
impl<W: Clone> Clone for PreparedH3EdgeGraph<W>
sourcefn clone(&self) -> PreparedH3EdgeGraph<W>
fn clone(&self) -> PreparedH3EdgeGraph<W>
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl<W> ConcaveHull for PreparedH3EdgeGraph<W>
impl<W> ConcaveHull for PreparedH3EdgeGraph<W>
sourceimpl<W> CoveredArea for PreparedH3EdgeGraph<W>
impl<W> CoveredArea for PreparedH3EdgeGraph<W>
type Error = Error
sourcefn covered_area(
&self,
reduce_resolution_by: u8
) -> Result<MultiPolygon<f64>, Self::Error>
fn covered_area(
&self,
reduce_resolution_by: u8
) -> Result<MultiPolygon<f64>, Self::Error>
calculates a
MultiPolygon of the area covered by a graph Read moresourceimpl<'de, W> Deserialize<'de> for PreparedH3EdgeGraph<W>where
W: Deserialize<'de>,
impl<'de, W> Deserialize<'de> for PreparedH3EdgeGraph<W>where
W: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<W> From<PreparedH3EdgeGraph<W>> for H3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy + Ord + Zero,
impl<W> From<PreparedH3EdgeGraph<W>> for H3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy + Ord + Zero,
sourcefn from(prepared_graph: PreparedH3EdgeGraph<W>) -> Self
fn from(prepared_graph: PreparedH3EdgeGraph<W>) -> Self
Converts to this type from the input type.
sourceimpl<W: Copy> GetCellEdges for PreparedH3EdgeGraph<W>
impl<W: Copy> GetCellEdges for PreparedH3EdgeGraph<W>
type EdgeWeightType = W
sourcefn get_edges_originating_from(
&self,
cell: &H3Cell
) -> Result<Vec<(H3DirectedEdge, EdgeWeight<'_, Self::EdgeWeightType>)>, Error>
fn get_edges_originating_from(
&self,
cell: &H3Cell
) -> Result<Vec<(H3DirectedEdge, EdgeWeight<'_, Self::EdgeWeightType>)>, Error>
get all edges and their values originating from cell
cellsourceimpl<W> GetCellNode for PreparedH3EdgeGraph<W>
impl<W> GetCellNode for PreparedH3EdgeGraph<W>
fn get_cell_node(&self, cell: &H3Cell) -> Option<NodeType>
sourceimpl<W> GetStats for PreparedH3EdgeGraph<W>
impl<W> GetStats for PreparedH3EdgeGraph<W>
fn get_stats(&self) -> Result<GraphStats, Error>
sourceimpl<W> HasH3Resolution for PreparedH3EdgeGraph<W>
impl<W> HasH3Resolution for PreparedH3EdgeGraph<W>
sourcefn h3_resolution(&self) -> u8
fn h3_resolution(&self) -> u8
Gets the index resolution (0-15)
sourceimpl<'a, W> IterateCellNodes<'a> for PreparedH3EdgeGraph<W>
impl<'a, W> IterateCellNodes<'a> for PreparedH3EdgeGraph<W>
type CellNodeIterator = Iter<'a, H3Cell, NodeType>
fn iter_cell_nodes(&'a self) -> Self::CellNodeIterator
sourceimpl<W> Serialize for PreparedH3EdgeGraph<W>where
W: Serialize,
impl<W> Serialize for PreparedH3EdgeGraph<W>where
W: Serialize,
sourceimpl<W> TryFrom<H3EdgeGraph<W>> for PreparedH3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy + Ord + Zero + Send + Sync,
impl<W> TryFrom<H3EdgeGraph<W>> for PreparedH3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy + Ord + Zero + Send + Sync,
impl<W> Sync for PreparedH3EdgeGraph<W>where
W: Sync,
Auto Trait Implementations
impl<W> RefUnwindSafe for PreparedH3EdgeGraph<W>where
W: RefUnwindSafe,
impl<W> Send for PreparedH3EdgeGraph<W>where
W: Send,
impl<W> Unpin for PreparedH3EdgeGraph<W>where
W: Unpin,
impl<W> UnwindSafe for PreparedH3EdgeGraph<W>where
W: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
sourceimpl<G, W> DifferentialShortestPath<W> for Gwhere
W: PartialOrd<W> + PartialEq<W> + Add<W> + Copy + Send + Ord + Zero + Sync,
G: GetCellEdges<EdgeWeightType = W> + GetCellNode + HasH3Resolution + NearestGraphNodes + Sync + ShortestPathManyToMany<W>,
impl<G, W> DifferentialShortestPath<W> for Gwhere
W: PartialOrd<W> + PartialEq<W> + Add<W> + Copy + Send + Ord + Zero + Sync,
G: GetCellEdges<EdgeWeightType = W> + GetCellNode + HasH3Resolution + NearestGraphNodes + Sync + ShortestPathManyToMany<W>,
fn differential_shortest_path_map<I, OPT, PM, O>(
&self,
origin_cells: I,
destination_cells: I,
exclude_cells: &H3Treemap<H3Cell>,
options: &OPT,
path_transform_fn: PM
) -> Result<HashMap<H3Cell, ExclusionDiff<O>, RandomState, Global>, Error>where
I: IntoIterator,
<I as IntoIterator>::Item: Borrow<H3Cell>,
OPT: ShortestPathOptions + Send + Sync,
O: Send + Ord + Clone,
PM: Fn(Path<W>) -> Result<O, Error> + Send + Sync,
fn differential_shortest_path<I, OPT>(
&self,
origin_cells: I,
destination_cells: I,
exclude_cells: &H3Treemap<H3Cell>,
options: &OPT
) -> Result<HashMap<H3Cell, ExclusionDiff<Path<W>>>, Error>where
I: IntoIterator,
I::Item: Borrow<H3Cell>,
OPT: ShortestPathOptions + Send + Sync,
sourceimpl<G> GetEdge for Gwhere
G: GetCellEdges,
impl<G> GetEdge for Gwhere
G: GetCellEdges,
type EdgeWeightType = <G as GetCellEdges>::EdgeWeightType
fn get_edge(
&self,
edge: &H3DirectedEdge
) -> Result<Option<EdgeWeight<'_, <G as GetEdge>::EdgeWeightType>>, Error>
sourceimpl<G> NearestGraphNodes for Gwhere
G: GetCellNode,
impl<G> NearestGraphNodes for Gwhere
G: GetCellNode,
sourcefn nearest_graph_nodes(
&self,
cell: &H3Cell,
max_distance_k: u32
) -> Result<NearestGraphNodesGetCellIter<'_, G>, Error>
fn nearest_graph_nodes(
&self,
cell: &H3Cell,
max_distance_k: u32
) -> Result<NearestGraphNodesGetCellIter<'_, G>, Error>
get an iterator over the closest corresponding nodes in the graph to the
given cell. The iterator will return all nodes with the
same, smallest
k <= max_distance_k which are part of the graph. Read moreimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<W, G> ShortestPath<W> for Gwhere
G: GetCellEdges<EdgeWeightType = W> + GetCellNode + HasH3Resolution + NearestGraphNodes,
W: PartialOrd<W> + PartialEq<W> + Add<W> + Copy + Ord + Zero,
impl<W, G> ShortestPath<W> for Gwhere
G: GetCellEdges<EdgeWeightType = W> + GetCellNode + HasH3Resolution + NearestGraphNodes,
W: PartialOrd<W> + PartialEq<W> + Add<W> + Copy + Ord + Zero,
fn shortest_path<I, OPT>(
&self,
origin_cell: H3Cell,
destination_cells: I,
options: &OPT
) -> Result<Vec<Path<W>, Global>, Error>where
I: IntoIterator,
<I as IntoIterator>::Item: Borrow<H3Cell>,
OPT: ShortestPathOptions,
sourceimpl<W, G> ShortestPathManyToMany<W> for Gwhere
G: GetCellEdges<EdgeWeightType = W> + GetCellNode + HasH3Resolution + NearestGraphNodes + Sync,
W: PartialOrd<W> + PartialEq<W> + Add<W> + Copy + Send + Ord + Zero + Sync,
impl<W, G> ShortestPathManyToMany<W> for Gwhere
G: GetCellEdges<EdgeWeightType = W> + GetCellNode + HasH3Resolution + NearestGraphNodes + Sync,
W: PartialOrd<W> + PartialEq<W> + Add<W> + Copy + Send + Ord + Zero + Sync,
sourcefn shortest_path_many_to_many_map<I, OPT, PM, O>(
&self,
origin_cells: I,
destination_cells: I,
options: &OPT,
path_transform_fn: PM
) -> Result<HashMap<H3Cell, Vec<O, Global>, RandomState, Global>, Error>where
I: IntoIterator,
<I as IntoIterator>::Item: Borrow<H3Cell>,
OPT: ShortestPathOptions + Send + Sync,
PM: Fn(Path<W>) -> Result<O, Error> + Send + Sync,
O: Send + Ord + Clone,
fn shortest_path_many_to_many_map<I, OPT, PM, O>(
&self,
origin_cells: I,
destination_cells: I,
options: &OPT,
path_transform_fn: PM
) -> Result<HashMap<H3Cell, Vec<O, Global>, RandomState, Global>, Error>where
I: IntoIterator,
<I as IntoIterator>::Item: Borrow<H3Cell>,
OPT: ShortestPathOptions + Send + Sync,
PM: Fn(Path<W>) -> Result<O, Error> + Send + Sync,
O: Send + Ord + Clone,
Returns found paths, transformed by the
path_map_fn and keyed by the
origin cell. Read moresourceimpl<W, G> WithinWeightThreshold<W> for Gwhere
G: GetCellEdges<EdgeWeightType = W>,
W: Zero + Ord + Copy + Add<W>,
impl<W, G> WithinWeightThreshold<W> for Gwhere
G: GetCellEdges<EdgeWeightType = W>,
W: Zero + Ord + Copy + Add<W>,
sourceimpl<W, G> WithinWeightThresholdMany<W> for Gwhere
G: GetCellEdges<EdgeWeightType = W> + WithinWeightThreshold<W> + Sync,
W: Zero + Ord + Copy + Add<W> + Send + Sync,
impl<W, G> WithinWeightThresholdMany<W> for Gwhere
G: GetCellEdges<EdgeWeightType = W> + WithinWeightThreshold<W> + Sync,
W: Zero + Ord + Copy + Add<W> + Send + Sync,
sourcefn cells_within_weight_threshold_many<I, AGG>(
&self,
origin_cells: I,
weight_threshold: W,
agg_fn: AGG
) -> Result<HashMap<H3Cell, W, RandomState, Global>, Error>where
I: IntoParallelIterator,
<I as IntoParallelIterator>::Item: Borrow<H3Cell>,
AGG: Fn(&mut W, W) + Sync,
fn cells_within_weight_threshold_many<I, AGG>(
&self,
origin_cells: I,
weight_threshold: W,
agg_fn: AGG
) -> Result<HashMap<H3Cell, W, RandomState, Global>, Error>where
I: IntoParallelIterator,
<I as IntoParallelIterator>::Item: Borrow<H3Cell>,
AGG: Fn(&mut W, W) + Sync,
Find all cells connected to the graph within a given
weight_threshold around the
given origin_cells. Read more