Struct h3ron_graph::graph::h3edge::H3EdgeGraph
source · [−]Fields
edges: H3EdgeMap<W>h3_resolution: u8Implementations
sourceimpl<W> H3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy,
impl<W> H3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy,
pub fn new(h3_resolution: u8) -> Self
sourcepub fn num_nodes(&self) -> Result<usize, Error>
pub fn num_nodes(&self) -> Result<usize, Error>
This has to generate the node list first, so its rather expensive to call.
pub fn num_edges(&self) -> usize
pub fn edge_weight(&self, edge: &H3DirectedEdge) -> Option<&W>
sourcepub fn edges_from_cell(
&self,
cell: &H3Cell
) -> Result<Vec<(&H3DirectedEdge, &W)>, Error>
pub fn edges_from_cell(
&self,
cell: &H3Cell
) -> Result<Vec<(&H3DirectedEdge, &W)>, Error>
get all edges in the graph leading from this edge to neighbors
sourcepub fn edges_to_cell(
&self,
cell: &H3Cell
) -> Result<Vec<(&H3DirectedEdge, &W)>, Error>
pub fn edges_to_cell(
&self,
cell: &H3Cell
) -> Result<Vec<(&H3DirectedEdge, &W)>, Error>
get all edges in the graph leading to this cell from its neighbors
pub fn add_edge_using_cells(
&mut self,
cell_from: H3Cell,
cell_to: H3Cell,
weight: W
) -> Result<(), Error>
pub fn add_edge_using_cells_bidirectional(
&mut self,
cell_from: H3Cell,
cell_to: H3Cell,
weight: W
) -> Result<(), Error>
pub fn add_edge(&mut self, edge: H3DirectedEdge, weight: W) -> Result<(), Error>
pub fn try_add(&mut self, other: Self) -> Result<(), Error>
sourcepub fn nodes(&self) -> Result<H3CellMap<NodeType>, Error>
pub fn nodes(&self) -> Result<H3CellMap<NodeType>, Error>
cells which are valid targets to route to
This is a rather expensive operation as nodes are not stored anywhere and need to be extracted from the edges.
pub fn iter_edges(&self) -> impl Iterator<Item = (H3DirectedEdge, &W)>
Trait Implementations
sourceimpl<W: Clone> Clone for H3EdgeGraph<W>
impl<W: Clone> Clone for H3EdgeGraph<W>
sourcefn clone(&self) -> H3EdgeGraph<W>
fn clone(&self) -> H3EdgeGraph<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> CoveredArea for H3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy,
impl<W> CoveredArea for H3EdgeGraph<W>where
W: PartialOrd + PartialEq + Add + Copy,
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 H3EdgeGraph<W>where
W: Deserialize<'de>,
impl<'de, W> Deserialize<'de> for H3EdgeGraph<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> GetEdge for H3EdgeGraph<W>where
W: Copy,
impl<W> GetEdge for H3EdgeGraph<W>where
W: Copy,
type EdgeWeightType = W
fn get_edge(
&self,
edge: &H3DirectedEdge
) -> Result<Option<EdgeWeight<'_, Self::EdgeWeightType>>, Error>
sourceimpl<W> GetStats for H3EdgeGraph<W>where
W: PartialEq + PartialOrd + Add + Copy,
impl<W> GetStats for H3EdgeGraph<W>where
W: PartialEq + PartialOrd + Add + Copy,
fn get_stats(&self) -> Result<GraphStats, Error>
sourceimpl<W> HasH3Resolution for H3EdgeGraph<W>
impl<W> HasH3Resolution for H3EdgeGraph<W>
sourcefn h3_resolution(&self) -> u8
fn h3_resolution(&self) -> u8
Gets the index resolution (0-15)
sourceimpl<T> OgrWrite for H3EdgeGraph<T>where
T: WeightFeatureField + Send + Sync,
impl<T> OgrWrite for H3EdgeGraph<T>where
T: WeightFeatureField + Send + Sync,
sourceimpl<W> Serialize for H3EdgeGraph<W>where
W: Serialize,
impl<W> Serialize for H3EdgeGraph<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,
Auto Trait Implementations
impl<W> RefUnwindSafe for H3EdgeGraph<W>where
W: RefUnwindSafe,
impl<W> Send for H3EdgeGraph<W>where
W: Send,
impl<W> Sync for H3EdgeGraph<W>where
W: Sync,
impl<W> Unpin for H3EdgeGraph<W>where
W: Unpin,
impl<W> UnwindSafe for H3EdgeGraph<W>where
W: UnwindSafe,
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