> ## 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.

# filter_by_area

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/filter_by_area.rs#L40-L59)
pub async fn [filter\_by\_area](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/filter-by-area.md#method.filter_by_area)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), view\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), x\_column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), x\_vector: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html)>, y\_column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), y\_vector: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html)>, ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[FilterByAreaResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByAreaResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Filter a dataset for records falling within a 2-D polygon’s boundaryCalculates which objects from a table are within a named area of interest (NAI/polygon). The operation is synchronous, meaning that a response will not be returned until all the matching objects are fully available. The response payload provides the count of the resulting set. A new resultant set (view) which satisfies the input NAI restriction specification is created with the name `view_name` passed in as part of the input.

##### Arguments

<ul>
  <li>`table_name` - Name of the table to filter, in \[schema\_name.]table\_name format, using standard name resolution rules. This may be the name of a table or a view (when chaining queries).</li>
  <li>`view_name` - If provided, then this will be the name of the view containing the results, in \[schema\_name.]view\_name format, using standard name resolution rules and meeting table naming criteria. Must not be an already existing table or view.</li>
  <li>`x_column_name` - Name of the column containing the x values to be filtered.</li>
  <li>`x_vector` - List of x coordinates of the vertices of the polygon representing the area to be filtered.</li>
  <li>`y_column_name` - Name of the column containing the y values to be filtered.</li>
  <li>`y_vector` - List of y coordinates of the vertices of the polygon representing the area to be filtered.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/filter_by_area.rs#L91-L117)
pub async fn [filter\_by\_area\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/filter-by-area.md#method.filter_by_area_with_opts)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), view\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), x\_column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), x\_vector: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html)>, y\_column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), y\_vector: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html)>, options: [FilterByAreaRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByAreaRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[FilterByAreaResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByAreaResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Filter a dataset for records falling within a 2-D polygon’s boundaryCalculates which objects from a table are within a named area of interest (NAI/polygon). The operation is synchronous, meaning that a response will not be returned until all the matching objects are fully available. The response payload provides the count of the resulting set. A new resultant set (view) which satisfies the input NAI restriction specification is created with the name `view_name` passed in as part of the input.

##### Arguments

<ul>
  <li>`table_name` - Name of the table to filter, in \[schema\_name.]table\_name format, using standard name resolution rules. This may be the name of a table or a view (when chaining queries).</li>
  <li>`view_name` - If provided, then this will be the name of the view containing the results, in \[schema\_name.]view\_name format, using standard name resolution rules and meeting table naming criteria. Must not be an already existing table or view.</li>
  <li>`x_column_name` - Name of the column containing the x values to be filtered.</li>
  <li>`x_vector` - List of x coordinates of the vertices of the polygon representing the area to be filtered.</li>
  <li>`y_column_name` - Name of the column containing the y values to be filtered.</li>
  <li>`y_vector` - List of y coordinates of the vertices of the polygon representing the area to be filtered.</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/filter_by_area.rs#L120-L131)
pub async fn [filter\_by\_area\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/filter-by-area.md#method.filter_by_area_raw)( \&self, request: &[FilterByAreaRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByAreaRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[FilterByAreaResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByAreaResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/filter_by_area.rs#L135-L147)
pub async fn [filter\_by\_area\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/filter-by-area.md#method.filter_by_area_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[FilterByAreaRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByAreaRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[FilterByAreaResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByAreaResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`FilterByAreaRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByAreaRequest) 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.