---
title: geo.filterRows() function
description: geo.filterRows() filters data by a specified geographic region with the option of strict filtering.
url: https://docs.influxdata.com/flux/v0/stdlib/experimental/geo/filterrows/
estimated_tokens: 2013
product: Flux
version: v0
---

# geo.filterRows() function

-   Flux 0.63.0+
-   View InfluxDB support

`geo.filterRows()` is experimental and [subject to change at any time](/flux/v0/stdlib/experimental/#experimental-packages-are-subject-to-change).

`geo.filterRows()` filters data by a specified geographic region with the option of strict filtering.

This function is a combination of `geo.gridFilter()` and `geo.strictFilter()`. Input data must include an `s2_cell_id` column that is **part of the group key**.

##### Function type signature

```js
(
    <-tables: stream[{B with s2_cell_id: string, lon: D, lat: C}],
    region: A,
    ?level: int,
    ?maxSize: int,
    ?minSize: int,
    ?s2cellIDLevel: int,
    ?strict: bool,
) => stream[{B with s2_cell_id: string, lon: D, lat: C}] where A: Record
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### region

(Required) Region containing the desired data points.

Specify record properties for the shape.

### minSize

Minimum number of cells that cover the specified region. Default is `24`.

### maxSize

Maximum number of cells that cover the specified region. Default is `-1` (unlimited).

### level

[S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html) of grid cells. Default is `-1`.

**Note:** `level` is mutually exclusive with `minSize` and `maxSize` and must be less than or equal to `s2cellIDLevel`.

### s2cellIDLevel

[S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html) used in the `s2_cell_id` tag. Default is `-1` (detects S2 cell level from the `s2_cell_id` tag).

### strict

Enable strict geographic data filtering. Default is `true`.

Strict filtering returns only points with coordinates in the defined region. Non-strict filtering returns all points from S2 grid cells that are partially covered by the defined region.

### tables

Input data. Default is piped-forward data (`<-`).

## Examples

-   [Strictly filter geotemporal data by region](#strictly-filter-geotemporal-data-by-region)
-   [Approximately filter geotemporal data by region](#approximately-filter-geotemporal-data-by-region)

### Strictly filter geotemporal data by region

```js
import "experimental/geo"

data
    |> geo.filterRows(region: {lat: 40.69335938, lon: -73.30078125, radius: 100.0})
```

### Approximately filter geotemporal data by region

```js
import "experimental/geo"

data
    |> geo.filterRows(region: {lat: 40.69335938, lon: -73.30078125, radius: 100.0}, strict: false)
```

#### Related

-   [geo.gridFilter() function](/flux/v0/stdlib/experimental/geo/gridfilter/)
-   [geo.strictFilter() function](/flux/v0/stdlib/experimental/geo/strictfilter/)
-   [Work with geo-temporal data](/influxdb/v2/query-data/flux/geo/)

[transformations](/flux/v0/tags/transformations/) [filters](/flux/v0/tags/filters/) [geotemporal](/flux/v0/tags/geotemporal/)
