> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# match_graph

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/match_graph.rs#L42-L57)
pub async fn [match\_graph](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/match-graph.md#method.match_graph)( \&self, graph\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), sample\_points: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, solve\_method: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), solution\_table: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[MatchGraphResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.MatchGraphResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Match sample points to a graph.Matches a directed route implied by a given set of latitude/longitude points to an existing underlying road network graph using a given solution type.IMPORTANT: It’s highly recommended that you review the Graphs and Solvers concepts documentation, the Graph REST Tutorial, and/or some /match/graph examples before using this endpoint.

##### Arguments

<ul>
  <li>`graph_name` - Name of the underlying geospatial graph resource to match to using `sample_points`.</li>
  <li>`sample_points` - Sample points used to match to an underlying geospatial graph. Sample points must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with: existing column names, e.g., ‘table.column AS SAMPLE\_X’; expressions, e.g., ‘ST\_MAKEPOINT(table.x, table.y) AS SAMPLE\_WKTPOINT’; or constant values, e.g., ‘\{1, 2, 10} AS SAMPLE\_TRIPID’.</li>
  <li>`solve_method` - The type of solver to use for graph matching.</li>
  <li>`solution_table` - The name of the table used to store the results, in \[schema\_name.]table\_name format, using standard name resolution rules and meeting table naming criteria. This table contains a track of geospatial points for the matched portion of the graph, a track ID, and a score value. Also outputs a details table containing a trip ID (that matches the track ID), the latitude/longitude pair, the timestamp the point was recorded at, and an edge ID corresponding to the matched road segment. Must not be an existing table of the same name.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/match_graph.rs#L91-L113)
pub async fn [match\_graph\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/match-graph.md#method.match_graph_with_opts)( \&self, graph\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), sample\_points: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, solve\_method: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), solution\_table: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), options: [MatchGraphRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.MatchGraphRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[MatchGraphResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.MatchGraphResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Match sample points to a graph.Matches a directed route implied by a given set of latitude/longitude points to an existing underlying road network graph using a given solution type.IMPORTANT: It’s highly recommended that you review the Graphs and Solvers concepts documentation, the Graph REST Tutorial, and/or some /match/graph examples before using this endpoint.

##### Arguments

<ul>
  <li>`graph_name` - Name of the underlying geospatial graph resource to match to using `sample_points`.</li>
  <li>`sample_points` - Sample points used to match to an underlying geospatial graph. Sample points must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with: existing column names, e.g., ‘table.column AS SAMPLE\_X’; expressions, e.g., ‘ST\_MAKEPOINT(table.x, table.y) AS SAMPLE\_WKTPOINT’; or constant values, e.g., ‘\{1, 2, 10} AS SAMPLE\_TRIPID’.</li>
  <li>`solve_method` - The type of solver to use for graph matching.</li>
  <li>`solution_table` - The name of the table used to store the results, in \[schema\_name.]table\_name format, using standard name resolution rules and meeting table naming criteria. This table contains a track of geospatial points for the matched portion of the graph, a track ID, and a score value. Also outputs a details table containing a trip ID (that matches the track ID), the latitude/longitude pair, the timestamp the point was recorded at, and an edge ID corresponding to the matched road segment. Must not be an existing table of the same name.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/match_graph.rs#L116-L127)
pub async fn [match\_graph\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/match-graph.md#method.match_graph_raw)( \&self, request: &[MatchGraphRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.MatchGraphRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[MatchGraphResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.MatchGraphResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`MatchGraphRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.MatchGraphRequest) to the `/match/graph` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/match_graph.rs#L131-L143)
pub async fn [match\_graph\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/match-graph.md#method.match_graph_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[MatchGraphRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.MatchGraphRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[MatchGraphResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.MatchGraphResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`MatchGraphRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.MatchGraphRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.