### OSMWay::new Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/struct.OSMWay.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new instance of an OSMWay. ```APIDOC ## pub fn new(id: u64, nodes: Vec, dists: Vec, highway_type: String) -> Self ### Description Creates a new OSMWay instance from the provided fields. ### Parameters - **id** (u64) - The way ID as defined in Overpass API. - **nodes** (Vec) - The node indices on the path. - **dists** (Vec) - The distances between nodes. - **highway_type** (String) - The type of way (e.g., highway, street, sidewalk). ``` -------------------------------- ### OverpassResponse File I/O Methods Source: https://docs.rs/osmgraph/latest/osmgraph/api/overpass_response/struct.OverpassResponse.html Methods for saving and loading OverpassResponse data to and from the local filesystem. ```APIDOC ## Method: save ### Description Asynchronously saves the OverpassResponse to the specified file path. ### Signature `pub async fn save(&self, filepath: &str) -> Result<(), Error>` ## Method: save_blocking ### Description Synchronously saves the OverpassResponse to the specified file path, blocking until completion. ### Signature `pub fn save_blocking(&self, filepath: &str) -> Result<(), Error>` ## Method: load ### Description Asynchronously loads an OverpassResponse from a JSON file at the specified path. ### Signature `pub async fn load(filepath: &str) -> Result` ## Method: load_blocking ### Description Synchronously loads an OverpassResponse from a JSON file at the specified path, blocking until completion. ### Signature `pub fn load_blocking(filepath: &str) -> Result` ``` -------------------------------- ### OSMEdge::new Source: https://docs.rs/osmgraph/latest/osmgraph/graph/edge/struct.OSMEdge.html?search=u32+-%3E+bool Creates a new instance of an OSMEdge. ```APIDOC ## pub fn new(nodes: [u64; 2], dist: f64, highway_type: String) -> Self ### Description Creates a new `OSMEdge` from the provided node IDs, distance, and highway type. ### Parameters - **nodes** ([u64; 2]) - The two node IDs connected by the edge. - **dist** (f64) - The distance between the nodes in meters. - **highway_type** (String) - The type of the edge (e.g., highway, street, sidewalk). ``` -------------------------------- ### QueryEngine::new Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new instance of the QueryEngine with the default Overpass API URL and default highway filters. ```APIDOC ## pub fn new() -> Self ### Description Creates a new instance of the query engine with the base URL set to https://overpass-api.de/api/interpreter and default filters for drivable roads. ``` -------------------------------- ### Configure QueryEngine URL Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Update the base URL for the QueryEngine using a functional style. ```rust use osmgraph::api::QueryEngine; let engine = QueryEngine::new() .with_url("www.url_example.com".to_string()); ``` -------------------------------- ### QueryEngine::new Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html Creates a new instance of the query engine with the default Overpass API URL and default highway filters. ```APIDOC ## QueryEngine::new ### Description Initializes a new QueryEngine instance configured with the default Overpass API interpreter URL and default driving-related highway filters. ### Signature `pub fn new() -> Self` ``` -------------------------------- ### Configure QueryEngine filters Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Update the default way filters for the QueryEngine using a functional style. ```rust use osmgraph::api::QueryEngine; let engine = QueryEngine::new() .with_filters(vec![String::from("motorway")]); ``` -------------------------------- ### QueryEngine::query Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Executes a raw Overpass Query Language (QL) string against the API. ```APIDOC ## pub async fn query(&self, query: String) -> Result ### Description Requests data from the Overpass API using a raw Overpass QL query string. ``` -------------------------------- ### Fetch OSM Data and Create a Graph Source: https://docs.rs/osmgraph/latest/osmgraph/index.html?search=std%3A%3Avec Demonstrates querying the Overpass API for a specific area and converting the resulting JSON response into an OSMGraph. ```rust use osmgraph::graph::{OSMGraph, create_graph}; use osmgraph::api::{QueryEngine, OverpassResponse, Element}; // Query to fetch all data related to "Selinsgrove" town in Pennsylvania let engine = QueryEngine::new(); let response: String = match engine.query_blocking(r#" [out:json][timeout:25]; area[name="Selinsgrove"][admin_level=8]->.searchArea; ( way(area.searchArea); node(area.searchArea); ); out body; >; out skel qt;"#.to_string() ) { Ok(response) => response, Err(_) => return, }; // Parse json let json: OverpassResponse = serde_json::from_str(&response) .expect("Was not able to parse data from json!"); let elements: &Vec = json.elements(); //Create graph let g: OSMGraph = create_graph(elements) .expect("Was not able to create graph from json!"); ``` -------------------------------- ### QueryEngine::query Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html Executes a raw Overpass QL query. ```APIDOC ## QueryEngine::query ### Description Sends a raw Overpass Query Language (QL) string directly to the API without modification. ### Parameters - **query** (String) - Required - A valid Overpass QL query string. ``` -------------------------------- ### QueryEngine::query Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=std%3A%3Avec Executes a raw Overpass QL query. ```APIDOC ## pub async fn query(&self, query: String) -> Result ### Description Sends a raw Overpass Query Language string directly to the Overpass API without modification. ``` -------------------------------- ### QueryEngine::query Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search= Executes a raw Overpass QL query. ```APIDOC ## pub async fn query(&self, query: String) -> Result ### Description Sends a raw Overpass Query Language (QL) string directly to the Overpass API without modification. ### Parameters - **query** (String) - Required - A valid Overpass QL query string. ``` -------------------------------- ### QueryEngine Methods Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=u32+-%3E+bool Methods available on the QueryEngine struct for configuring the engine and executing API requests. ```APIDOC ## QueryEngine::new Creates a new instance of the query engine with the default Overpass API URL. ## QueryEngine::with_url Sets a new base URL for the query engine. Returns a new instance. ## QueryEngine::with_filters Sets custom way filters for high-level queries. Returns a new instance. ## QueryEngine::query_place Fetches nodes and ways for a specific area name and optional admin level (async). ## QueryEngine::query_poly Fetches nodes and ways within a provided closed polygon (async). ## QueryEngine::query Sends a raw Overpass QL query string to the API (async). ## Blocking Variants - query_place_blocking - query_poly_blocking - query_blocking These methods provide the same functionality as their async counterparts but block execution until the request completes. ``` -------------------------------- ### create_graph Source: https://docs.rs/osmgraph/latest/osmgraph/graph/graph/fn.create_graph.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Parses a collection of elements into an OSMGraph structure. ```APIDOC ## Function: create_graph ### Description This function attempts to parse an `OSMGraph` from a provided vector of `Element` structures. ### Signature `pub fn create_graph(elements: &Vec) -> Result>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to be parsed into a graph. ### Returns - **Result>** - Returns an `OSMGraph` on success, or an error if the parsing fails. ``` -------------------------------- ### Define QueryEngine structure Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The internal structure definition for the QueryEngine. ```rust pub struct QueryEngine { /* private fields */ } ``` -------------------------------- ### QueryEngine::query_place Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Fetches nodes and ways for a specific area by name and optional administrative level. ```APIDOC ## pub async fn query_place(&self, area_name: String, admin_level: Option) -> Result ### Description Given an area name (e.g., 'Manhattan') and an optional admin level, this method returns the nodes and ways for that specific area. ``` -------------------------------- ### QueryEngine::query_place Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html Fetches nodes and ways for a specific area by name. ```APIDOC ## QueryEngine::query_place ### Description Retrieves nodes and ways for a specified area name (e.g., 'Germany'). An optional admin_level can be provided to refine the scope of the search. ### Parameters - **area_name** (String) - Required - The name of the area to query. - **admin_level** (Option) - Optional - The administrative level scope (e.g., 2 for countries, 8 for cities). ``` -------------------------------- ### create_graph function signature Source: https://docs.rs/osmgraph/latest/osmgraph/graph/graph/fn.create_graph.html The function signature for creating an OSMGraph from a vector of elements. ```rust pub fn create_graph(elements: &Vec) -> Result> ``` -------------------------------- ### QueryEngine::query_place Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search= Fetches nodes and ways for a specific area by name, optionally filtered by administrative level. ```APIDOC ## pub async fn query_place(&self, area_name: String, admin_level: Option) -> Result ### Description Retrieves nodes and ways for a specified area name (e.g., 'Germany'). The admin_level parameter helps refine the scope of the area. ### Parameters - **area_name** (String) - Required - The name of the area to query. - **admin_level** (Option) - Optional - The administrative level representing the scope of the area (e.g., 2 for countries, 8 for cities). ``` -------------------------------- ### OSMWay Accessor Methods Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/struct.OSMWay.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods to retrieve properties of an OSMWay instance. ```APIDOC ## Accessor Methods ### pub fn id(&self) -> u64 Returns the way ID. ### pub fn nodes(&self) -> &Vec Returns the nodes on this way. ### pub fn dists(&self) -> &Vec Returns the distances between nodes. ### pub fn highway_type(&self) -> &str Returns the type of way. ``` -------------------------------- ### create_graph Source: https://docs.rs/osmgraph/latest/osmgraph/graph/graph/fn.create_graph.html Parses an OSMGraph from a provided vector of elements. ```APIDOC ## Function: create_graph ### Description Given a json type structure, this function tries to parse an `OSMGraph` out of that json. ### Signature `pub fn create_graph(elements: &Vec) -> Result>` ### Parameters - **elements** (&Vec) - Required - A vector of elements to be parsed into an OSMGraph. ### Returns - **Result>** - Returns an `OSMGraph` on success, or an error if parsing fails. ``` -------------------------------- ### get_osm_ways(elements: &Vec) -> Result, Box> Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/fn.get_osm_ways.html?search=u32+-%3E+bool Parses a JSON-like structure of elements to extract all OSMWay objects. ```APIDOC ## get_osm_ways ### Description Given a json type structure, this function tries to parse all `OSMWay` out of that json. ### Signature `pub fn get_osm_ways(elements: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to be parsed. ### Returns - **Result, Box>** - A Result containing a vector of `OSMWay` objects on success, or an error if parsing fails. ``` -------------------------------- ### create_graph Source: https://docs.rs/osmgraph/latest/osmgraph/graph/graph/index.html Parses a JSON structure into an OSMGraph object. ```APIDOC ## create_graph ### Description Given a json type structure, this function tries to parse an `OSMGraph` out of that json. ### Signature `pub fn create_graph(json: Value) -> Result` ``` -------------------------------- ### OSMEdge Accessor Methods Source: https://docs.rs/osmgraph/latest/osmgraph/graph/edge/struct.OSMEdge.html?search=u32+-%3E+bool Methods to retrieve properties of an OSMEdge instance. ```APIDOC ## pub fn nodes(&self) -> [u64; 2] ### Description Retrieves the IDs of the two nodes connected by this edge. ## pub fn dist(&self) -> f64 ### Description Retrieves the length of the `OSMEdge` in meters. ## pub fn highway_type(&self) -> &str ### Description Retrieves the type of the `OSMEdge` (e.g., highway, street, sidewalk). ``` -------------------------------- ### QueryEngine::query_blocking Source: https://docs.rs/osmgraph/latest/osmgraph/index.html?search= Executes a blocking query against the Overpass API using the Overpass Query Language. ```APIDOC ## QueryEngine::query_blocking ### Description Sends a query string to the Overpass API and returns the raw response as a String. ### Parameters - **query** (String) - Required - The Overpass Query Language string to execute. ### Response - **Result** - Returns the raw API response on success, or an error if the request fails. ``` -------------------------------- ### OSMGraph struct definition Source: https://docs.rs/osmgraph/latest/osmgraph/graph/graph/type.OSMGraph.html Shows the internal structure of the OSMGraph type. ```rust pub struct OSMGraph { /* private fields */ } ``` -------------------------------- ### get_osm_ways function signature Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/fn.get_osm_ways.html The function signature for parsing OSM ways from a vector of elements. ```rust pub fn get_osm_ways( elements: &Vec, ) -> Result, Box> ``` -------------------------------- ### get_osm_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/fn.get_osm_ways.html?search= Parses a vector of elements into a list of OSMWay objects. ```APIDOC ## Function: get_osm_ways ### Description Given a JSON-type structure, this function attempts to parse all `OSMWay` objects from the provided elements. ### Signature `pub fn get_osm_ways(elements: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - Required - A reference to a vector of elements to be parsed. ### Returns - **Result, Box>** - Returns a vector of `OSMWay` objects on success, or an error if parsing fails. ``` -------------------------------- ### get_osm_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/fn.get_osm_ways.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Parses a vector of elements into a list of OSMWay objects. ```APIDOC ## get_osm_ways ### Description Given a json type structure, this function tries to parse all `OSMWay` out of that json. ### Signature `pub fn get_osm_ways(elements: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to be parsed. ``` -------------------------------- ### OverpassResponse Methods Source: https://docs.rs/osmgraph/latest/osmgraph/api/overpass_response/struct.OverpassResponse.html?search=u32+-%3E+bool Methods available on the OverpassResponse struct for accessing response data and file I/O operations. ```APIDOC ## elements() ### Description Returns the `elements` field from the response, which contains the actual graph information. ## generator() ### Description Returns the `generator` field from the response. ## osm3s() ### Description Returns the `osm3s` field from the response. ## version() ### Description Returns the `version` field from the response. ## save(filepath: &str) ### Description Asynchronously saves the OverpassResponse to the specified file path. ## save_blocking(filepath: &str) ### Description Synchronously saves the OverpassResponse to the specified file path. ## load(filepath: &str) ### Description Asynchronously loads an OverpassResponse from a JSON file at the specified path. ## load_blocking(filepath: &str) ### Description Synchronously loads an OverpassResponse from a JSON file at the specified path. ``` -------------------------------- ### get_osm_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/fn.get_osm_ways.html Parses a vector of elements into a collection of OSMWay objects. ```APIDOC ## get_osm_ways ### Description Given a json type structure, this function tries to parse all OSMWay objects out of that json. ### Signature `pub fn get_osm_ways(elements: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - Required - A vector of elements to be parsed into OSMWay objects. ### Returns - **Result, Box>** - Returns a vector of OSMWay objects on success, or an error if parsing fails. ``` -------------------------------- ### QueryEngine::query_poly Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search= Fetches nodes and ways within a defined polygon. ```APIDOC ## pub async fn query_poly(&self, polygon: Vec<(f64, f64)>) -> Result ### Description Returns all nodes and ways contained within a closed polygon. The first and last coordinate pairs in the vector must be identical to close the polygon. ### Parameters - **polygon** (Vec<(f64, f64)>) - Required - A list of coordinate pairs defining the boundary. ``` -------------------------------- ### QueryEngine::query_poly Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html Fetches nodes and ways within a defined polygon. ```APIDOC ## QueryEngine::query_poly ### Description Retrieves all nodes and ways contained within a provided closed polygon. The first and last coordinate pairs in the vector must be identical. ### Parameters - **polygon** (Vec<(f64, f64)>) - Required - A list of coordinate pairs defining the boundary. ``` -------------------------------- ### Define OSMNode struct Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/struct.OSMNode.html?search=u32+-%3E+bool The internal structure definition for OSMNode. ```rust pub struct OSMNode { /* private fields */ } ``` -------------------------------- ### QueryEngine::query_poly Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=std%3A%3Avec Fetches nodes and ways within a specified polygon. ```APIDOC ## pub async fn query_poly(&self, polygon: Vec<(f64, f64)>) -> Result ### Description Given a closed polygon defined by a vector of coordinates, this method returns all nodes and ways within that polygon. Note that the first and last coordinate must be identical. ``` -------------------------------- ### get_osm_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/fn.get_osm_ways.html?search=std%3A%3Avec Parses a vector of elements into a vector of OSMWay objects. ```APIDOC ## pub fn get_osm_ways(elements: &Vec) -> Result, Box> ### Description This function takes a reference to a vector of `Element` types and attempts to parse and return all `OSMWay` objects contained within that structure. ### Parameters - **elements** (&Vec) - Required - A reference to a vector of elements to be parsed. ### Returns - **Result, Box>** - Returns a vector of `OSMWay` objects on success, or an error if parsing fails. ``` -------------------------------- ### get_nodes_from_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_nodes_from_ways.html?search=u32+-%3E+bool Parses OSMNode objects from a vector of elements that are associated with the provided OSMWay objects. ```APIDOC ## Function: get_nodes_from_ways ### Description Given a json type structure and a `Vec`, this function tries to parse all `OSMNodes` out of that json if and only if the node lies on one of the ways provided. ### Signature `pub fn get_nodes_from_ways(elements: &Vec, ways: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to search through. - **ways** (&Vec) - A reference to a vector of OSMWay objects used to filter the nodes. ### Returns - **Result, Box>** - A vector of OSMNode objects if successful, or an error if the parsing fails. ``` -------------------------------- ### get_osm_nodes function signature Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_osm_nodes.html?search= The function signature for parsing OSM nodes from a vector of elements. ```rust pub fn get_osm_nodes( elements: &Vec, ) -> Result, Box> ``` -------------------------------- ### OverpassResponse Data Access Methods Source: https://docs.rs/osmgraph/latest/osmgraph/api/overpass_response/struct.OverpassResponse.html Methods to retrieve specific fields from the Overpass API response structure. ```APIDOC ## Method: elements ### Description Returns the `elements` field from the response, which contains the core graph information. ### Signature `pub fn elements(&self) -> &Vec` ## Method: generator ### Description Returns the `generator` field from the response. ### Signature `pub fn generator(&self) -> &Value` ## Method: osm3s ### Description Returns the `osm3s` field from the response. ### Signature `pub fn osm3s(&self) -> &Value` ## Method: version ### Description Returns the `version` field from the response. ### Signature `pub fn version(&self) -> &Value` ``` -------------------------------- ### get_osm_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/index.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Parses a collection of OSMWay objects from a provided JSON structure. ```APIDOC ## Function: get_osm_ways ### Description Parses a JSON structure to extract all `OSMWay` objects contained within it. ### Signature `pub fn get_osm_ways(json: Value) -> Vec` ### Parameters - **json** (Value) - The JSON structure containing the way data to be parsed. ``` -------------------------------- ### get_osm_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/way/index.html?search=std%3A%3Avec Parses a collection of OSMWay objects from a provided JSON structure. ```APIDOC ## Function: get_osm_ways ### Description Parses all OSMWay objects from a given JSON-type structure. ### Signature `pub fn get_osm_ways(json: Value) -> Vec` ### Parameters - **json** (Value) - The JSON structure containing way data to be parsed. ``` -------------------------------- ### QueryEngine::query_poly Source: https://docs.rs/osmgraph/latest/osmgraph/api/query_engine/struct.QueryEngine.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Fetches nodes and ways within a specified closed polygon. ```APIDOC ## pub async fn query_poly(&self, polygon: Vec<(f64, f64)>) -> Result ### Description Given a closed polygon defined by a vector of coordinates, this method returns all nodes and ways within that polygon. Note that the first and last elements of the vector must be identical. ``` -------------------------------- ### get_nodes_from_ways function signature Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_nodes_from_ways.html?search= The function signature for extracting nodes from ways, requiring a vector of elements and a vector of ways. ```rust pub fn get_nodes_from_ways( elements: &Vec, ways: &Vec, ) -> Result, Box> ``` -------------------------------- ### OverpassResponse Struct Definition Source: https://docs.rs/osmgraph/latest/osmgraph/api/overpass_response/struct.OverpassResponse.html?search=std%3A%3Avec The primary structure for representing responses from the Overpass API. ```rust pub struct OverpassResponse { /* private fields */ } ``` -------------------------------- ### get_nodes_from_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_nodes_from_ways.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Parses OSMNode objects from a vector of elements if they are contained within the provided OSMWay objects. ```APIDOC ## Function: get_nodes_from_ways ### Description Given a JSON-type structure and a `Vec`, this function attempts to parse all `OSMNode` objects out of the elements if and only if the node lies on one of the ways provided. ### Signature `pub fn get_nodes_from_ways(elements: &Vec, ways: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to search through. - **ways** (&Vec) - A reference to a vector of OSMWay objects defining the paths to filter by. ### Returns - **Result, Box>** - A vector of found OSMNode objects, or an error if the parsing fails. ``` -------------------------------- ### get_nodes_from_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_nodes_from_ways.html?search=std%3A%3Avec Parses OSMNodes from a list of elements if they are contained within the provided OSMWays. ```APIDOC ## Function: get_nodes_from_ways ### Description Given a collection of elements and a list of OSMWay objects, this function extracts all OSMNode objects that lie on the provided ways. ### Signature `pub fn get_nodes_from_ways(elements: &Vec, ways: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to search. - **ways** (&Vec) - A reference to a vector of OSMWay objects used to filter the nodes. ### Returns - **Result, Box>** - A vector of OSMNode objects that were found on the specified ways, or an error if the operation fails. ``` -------------------------------- ### get_nodes_from_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_nodes_from_ways.html Parses OSMNodes from a list of elements if they are contained within the provided OSMWays. ```APIDOC ## Function: get_nodes_from_ways ### Description Given a collection of elements and a list of OSMWay objects, this function extracts all OSMNode objects that lie on the provided ways. ### Signature `pub fn get_nodes_from_ways(elements: &Vec, ways: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to search through. - **ways** (&Vec) - A reference to a vector of OSMWay objects used to filter the nodes. ### Returns - **Result, Box>** - A vector of OSMNode objects if successful, or an error if the parsing fails. ``` -------------------------------- ### get_nodes_from_ways Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_nodes_from_ways.html?search= Parses OSMNodes from a list of elements that are contained within the specified OSMWays. ```APIDOC ## Function: get_nodes_from_ways ### Description Given a collection of elements and a list of OSMWays, this function extracts all OSMNodes that lie on the provided ways. ### Signature `pub fn get_nodes_from_ways(elements: &Vec, ways: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to search through. - **ways** (&Vec) - A reference to a vector of OSMWays used to filter the nodes. ### Returns - **Result, Box>** - A vector of OSMNodes found on the specified ways, or an error if the operation fails. ``` -------------------------------- ### get_osm_nodes Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_osm_nodes.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Parses a collection of elements into OSMNode structures. ```APIDOC ## Function: get_osm_nodes ### Description Parses a JSON-like structure of elements to extract all `OSMNode` objects. ### Signature `pub fn get_osm_nodes(elements: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to be parsed. ### Returns - **Result, Box>** - Returns a vector of `OSMNode` objects on success, or an error if parsing fails. ``` -------------------------------- ### OSMGraph Source: https://docs.rs/osmgraph/latest/osmgraph/graph/graph/index.html Type alias for the graph structure used in the library. ```APIDOC ## OSMGraph ### Description `OSMGraph` is a type redefinition of `UnGraph`. ``` -------------------------------- ### get_osm_nodes Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_osm_nodes.html?search=std%3A%3Avec Parses a collection of elements into a vector of OSMNode objects. ```APIDOC ## Function: get_osm_nodes ### Description Given a JSON-like structure, this function attempts to parse all `OSMNode` objects from the provided elements. ### Signature `pub fn get_osm_nodes(elements: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to be parsed. ### Returns - **Result, Box>** - A result containing a vector of parsed `OSMNode` objects, or an error if parsing fails. ``` -------------------------------- ### get_osm_nodes Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_osm_nodes.html?search=u32+-%3E+bool Parses a vector of elements into a vector of OSMNode objects. ```APIDOC ## Function: get_osm_nodes ### Description Given a JSON-like structure, this function attempts to parse all `OSMNode` objects from the provided elements. ### Signature `pub fn get_osm_nodes(elements: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to be parsed. ### Returns - **Result, Box>** - A vector of parsed `OSMNode` objects, or an error if parsing fails. ``` -------------------------------- ### get_osm_nodes Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_osm_nodes.html?search= Parses a vector of elements into a vector of OSMNode objects. ```APIDOC ## get_osm_nodes ### Description Given a JSON-type structure, this function attempts to parse all `OSMNode` objects from the provided elements. ### Signature `pub fn get_osm_nodes(elements: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - A reference to a vector of elements to be parsed. ### Returns - **Result, Box>** - A vector of successfully parsed `OSMNode` objects, or an error if parsing fails. ``` -------------------------------- ### get_osm_nodes Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.get_osm_nodes.html Parses a vector of elements into a vector of OSMNode objects. ```APIDOC ## Function: get_osm_nodes ### Description Parses all `OSMNodes` from a provided vector of `Element` structures. ### Signature `pub fn get_osm_nodes(elements: &Vec) -> Result, Box>` ### Parameters - **elements** (&Vec) - Required - A reference to a vector of elements to be parsed. ### Returns - **Result, Box>** - Returns a vector of `OSMNode` objects on success, or an error if parsing fails. ``` -------------------------------- ### Define OSMGraph type alias Source: https://docs.rs/osmgraph/latest/osmgraph/graph/graph/type.OSMGraph.html Represents the type definition for OSMGraph as an UnGraph. ```rust pub type OSMGraph = UnGraph; ``` -------------------------------- ### Define OSMEdge struct Source: https://docs.rs/osmgraph/latest/osmgraph/graph/edge/struct.OSMEdge.html?search=std%3A%3Avec The definition of the OSMEdge struct containing private fields. ```rust pub struct OSMEdge { /* private fields */ } ``` -------------------------------- ### filter_unconnected_nodes function signature Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.filter_unconnected_nodes.html?search= The function signature for filtering nodes based on their presence in a set of ways. ```rust pub fn filter_unconnected_nodes( ways: &Vec, nodes: Vec, ) -> Vec ``` -------------------------------- ### filter_unconnected_nodes Source: https://docs.rs/osmgraph/latest/osmgraph/graph/node/fn.filter_unconnected_nodes.html?search= Filters a list of OSM nodes to include only those that are part of the provided OSM ways. ```APIDOC ## Function: filter_unconnected_nodes ### Description Given a set of nodes and ways, this function parses all `OSMNodes` that lie on one of the ways provided and returns the filtered list. ### Signature `pub fn filter_unconnected_nodes(ways: &Vec, nodes: Vec) -> Vec` ### Parameters - **ways** (&Vec) - A reference to a vector of OSMWay objects to check against. - **nodes** (Vec) - A vector of OSMNode objects to be filtered. ### Returns - **Vec** - A vector containing only the nodes that are present in at least one of the provided ways. ``` -------------------------------- ### Define Element Enum Source: https://docs.rs/osmgraph/latest/osmgraph/api/overpass_response/enum.Element.html?search=std%3A%3Avec The Element enum structure used to represent OSM nodes and ways. ```rust pub enum Element { Node { id: u64, lat: f64, lon: f64, tags: Option>, }, Way { id: u64, nodes: Vec, tags: Option, }, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.