diff --git a/content/v2.0/reference/flux/stdlib/experimental/geo/s2cellidtoken.md b/content/v2.0/reference/flux/stdlib/experimental/geo/s2cellidtoken.md new file mode 100644 index 000000000..01383d397 --- /dev/null +++ b/content/v2.0/reference/flux/stdlib/experimental/geo/s2cellidtoken.md @@ -0,0 +1,83 @@ +--- +title: geo.s2CellIDToken() function +description: > + The `geo.s2CellIDToken()` function returns an S2 cell ID token. +menu: + v2_0_ref: + name: geo.s2CellIDToken + parent: Geo +weight: 401 +v2.0/tags: [functions, geo] +--- + +The `geo.s2CellIDToken()` function returns an S2 cell ID token. + +_**Function type:** Transformation_ + +```js +import "experimental/geo" + +geo.s2CellIDToken( + point: {lat: 37.7858229, lon: -122.4058124}, + level: 10 +) +``` + +## Parameters + +### point +Longitude and latitude in **decimal degrees** (WGS 84) to use when generating +the S2 cell ID token. +Object must contain `lat` and `lon` properties. + +_**Data type:** Object_ + +### token +S2 cell ID token to update. +Useful for changing the S2 cell level of an existing S2 cell ID token. + +_**Data type:** String_ + +{{% note %}} +`point` and `token` are mutually exclusive. +{{% /note %}} + +### level +[S2 cell level](https://s2geometry.io/resources/s2cell_statistics.html) to use +when generating the S2 cell ID token. + +_**Data type:** Integer_ + +## Examples + +##### Use latitude and longitude values to generate S2 cell ID tokens +```js +import "experimental/geo" + +from(bucket: "example-bucket") + |> range(start: -1h) + |> filter(fn: (r) => r._measurement == "example-measurement") + |> map(fn: (r) => ({ + r with + s2_cell_id: geo.s2CellIDToken( + point: {lat: r.lat, lon: r.lon}, + level: 10 + )}) + ) +``` + +##### Update S2 cell ID token level +```js +import "experimental/geo" + +from(bucket: "example-bucket") + |> range(start: -1h) + |> filter(fn: (r) => r._measurement == "example-measurement") + |> map(fn: (r) => ({ + r with + s2_cell_id: geo.s2CellIDToken( + token: r.s2_cell_id, + level: 10 + )}) + ) +``` diff --git a/content/v2.0/reference/release-notes/flux.md b/content/v2.0/reference/release-notes/flux.md index d1d521ef4..e2afcd01b 100644 --- a/content/v2.0/reference/release-notes/flux.md +++ b/content/v2.0/reference/release-notes/flux.md @@ -16,6 +16,21 @@ Though newer versions of Flux may be available, they will not be included with InfluxDB until the next InfluxDB v2.0 release._ {{% /note %}} +## v0.64.0 [2020-03-11] + +### Features +- Hand-transpile `elapsed()` aggregate. +- Hand-transpile `cumulative_sum()`. + +### Bug fixes +- Add response reader as dependency to tune response size. +- Handle unfinished option statement without panic. +- Simplify libflux C API and resolve memory leaks. +- Don't construct a `compiler.compilerScope` with a nil `value.Scope` as base. +- Influxql-decode to handle the case without tag set. + +--- + ## v0.63.0 [2020-03-03] ### Features