Documentation

geo.filterRows() function

geo.filterRows() is experimental and subject to change at any time.

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

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

import "experimental/geo"

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

Approximately filter geotemporal data by region

import "experimental/geo"

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

Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

InfluxDB v3 enhancements and InfluxDB Clustered is now generally available

New capabilities, including faster query performance and management tooling advance the InfluxDB v3 product line. InfluxDB Clustered is now generally available.

InfluxDB v3 performance and features

The InfluxDB v3 product line has seen significant enhancements in query performance and has made new management tooling available. These enhancements include an operational dashboard to monitor the health of your InfluxDB cluster, single sign-on (SSO) support in InfluxDB Cloud Dedicated, and new management APIs for tokens and databases.

Learn about the new v3 enhancements


InfluxDB Clustered general availability

InfluxDB Clustered is now generally available and gives you the power of InfluxDB v3 in your self-managed stack.

Talk to us about InfluxDB Clustered