Fix s2geo documentation and code to reflect current plugin name

This commit is contained in:
Daniel Nelson
2020-03-18 12:28:02 -07:00
parent ffaa9467a5
commit 35ef2559d3
5 changed files with 17 additions and 14 deletions

View File

@@ -7,16 +7,17 @@ The `lat` and `lon` fields values should contain WGS-84 coordinates in decimal d
### Configuration
```toml
[[processors.geo]]
## The name of the lat and lon fields containing WGS-84 latitude and longitude in decimal degrees
lat_field = "lat"
lon_field = "lon"
[[processors.s2geo]]
## The name of the lat and lon fields containing WGS-84 latitude and
## longitude in decimal degrees.
# lat_field = "lat"
# lon_field = "lon"
## New tag to create
tag_key = "s2_cell_id"
# tag_key = "s2_cell_id"
## Cell level (see https://s2geometry.io/resources/s2cell_statistics.html)
cell_level = 11
# cell_level = 9
```
### Example

View File

@@ -2,6 +2,7 @@ package geo
import (
"fmt"
"github.com/golang/geo/s2"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/processors"
@@ -15,15 +16,16 @@ type Geo struct {
}
var SampleConfig = `
## The name of the lat and lon fields containing WGS-84 latitude and longitude in decimal degrees
lat_field = "lat"
lon_field = "lon"
## The name of the lat and lon fields containing WGS-84 latitude and
## longitude in decimal degrees.
# lat_field = "lat"
# lon_field = "lon"
## New tag to create
tag_key = "s2_cell_id"
# tag_key = "s2_cell_id"
## Cell level (see https://s2geometry.io/resources/s2cell_statistics.html)
cell_level = 9
# cell_level = 9
`
func (g *Geo) SampleConfig() string {
@@ -31,7 +33,7 @@ func (g *Geo) SampleConfig() string {
}
func (g *Geo) Description() string {
return "Reads latitude and longitude fields and adds tag with with S2 cell ID token of specified level."
return "Add the S2 Cell ID as a tag based on latitude and longitude fields"
}
func (g *Geo) Init() error {