docs-v2/content/influxdb/v2.0/query-data/flux/geo/_index.md

2.4 KiB

title list_title description menu weight list_code_example
Work with geo-temporal data Geo-temporal data Use the Flux Geo package to filter geo-temporal data and group by geographic location or track.
influxdb_2_0
name parent
Geo-temporal data Query with Flux
220 ```js import "experimental/geo" sampleGeoData |> geo.filterRows(region: {lat: 30.04, lon: 31.23, radius: 200.0}) |> geo.groupByArea(newColumn: "geoArea", level: 5) ```

Use the Flux Geo package to filter geo-temporal data and group by geographic location or track.

{{% warn %}} The Geo package is experimental and subject to change at any time. By using it, you agree to the risks of experimental functions. {{% /warn %}}

To work with geo-temporal data:

  1. Import the experimental/geo package.

    import "experimental/geo"
    
  2. Load geo-temporal data. See below for sample geo-temporal data.

  3. Do one or more of the following:

{{< children >}}


Sample data

Many of the examples in this section use a sampleGeoData variable that represents a sample set of geo-temporal data. The Bird Migration Sample Data provides sample geo-temporal data that meets the requirements of the Flux Geo package.

Load bird migration sample data

Use the sample.data() function to load the sample bird migration data:

import "influxdata/influxdb/sample"

sampleGeoData = sample.data(set: "birdMigration")

{{% note %}} sample.data() downloads sample data each time you execute the query (~1.3 MB). If bandwidth is a concern, use the to() function to write the data to a bucket, and then query the bucket with from(). {{% /note %}}