Plugins 〉GeoLoop
The GeoLoop plugin has been deprecated and is no longer maintained.
GeoLoop
GeoLoop Panel Plugin for Grafana
The GeoLoop Panel is a simple visualizer for joining GeoJSON to Time Series data, and animating the geo features in a loop. You can link Polygon, Point, or Line attributes to dynamic data fetched through Grafana. An example use might be to visualize the hourly varying temperature at land-based weather stations across the country, or to view the evolution of water quality along a stream or tributary. The image above is showing the rate of rainfall during a 5-hour storm passing over Cincinnati, Ohio, U.S., in March of 2017.
Ready to get going? If you know how to use GeoJSON and InfluxDB, then you're most of the way there.
- Wrap up your GeoJSON in a callback:
geo({ "type": "FeatureCollection", ... });
and put it on a server somewhere. - Make sure that each GeoJSON feature has some property value that corresponds to some tag value in your InfluxDB.
- Get a free MapBox API Key.
But wait, where do I get/host some GeoJSON?
You could GoogBingSearch(tm) for your relevant GIS data set, in GeoJSON format. Here is a set of files for US states, counties, and congressional districts. If you have shapefiles, you can convert using the OGR tools in GDAL. If your geography is not too complicated an you want to make your own, use something like geojson.io. For serving the GeoJSON data to GeoLoop, you could use Caddy, or use a very simple Nginx docker container to serve the file. Whatever you do, just remember to wrap the entire FeatureCollection
in a callback to get around CORS.
Simple Example
Say you're using InfluxDB's sample data set. Your query might look like this:
Notice the GROUP BY tag(location)
? That's super important. It's what causes the data source to spit out the series alias in the format index.mean {location:coyote_creek}
- otherwise the location would be hidden, aggregated, or otherwise lost. On a related note, please observe that the ALIAS
field is empty. If we have an alias, then the data given to GeoLoop will loose the tagging we just discussed. Don't fall into this trap! GeoLoop needs the series to be separated into tags, and for those tags to be intact in the series metadata. If you must use an alias, then make sure that you reproduce the tag formatting so GeoLoop can pick up the value of the location tag: ALIAS: $m.myAlias {location:$tag_myLocationTag}
.
Now, hop over to the "GeoLoop" tab.
Map Options
This is where you enter your MapBox API key, set the default center/zoom for the map view, and configure the data/viz options.
Map Data Options
Your GeoJSON must be downloadable as (Geo)JSONP - that is, within a callback. Enter the URL and callback name here. Also enter the Time Series tag that will be used to coordinate between the Series and the GeoJSON Features. Specify which type of feature you want to visualize (Line, Point, or Polygon). The map will filter those features and only show the type you specify.
Use the "GeoJSON ID Path" to designate the dot-separated key path of your GeoJSON Features that correspond to the tag you're referencing from the Time Series location tag. If your features have a path properties.FEATURE_ID
that references the same value you expect from the Time Series location tag, then enter that here. For example, suppose we are working with the 344 climate divisions in the U.S. Climate Divisional Dataset. If our GeoJSON data were of the format:
{ "type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"STATE": "New Mexico",
"STATE_CODE": 29,
"CLIMDIV": 2905,
"NAME": "CENTRAL VALLEY",
...
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[ -105.87799800030689, 33.24399899955506 ],
[ -105.98500100019538, 33.269000999597324 ],
...
]
]
}
},
{
"type": "Feature",
"properties": {
"STATE": "New Mexico",
"STATE_CODE": 29,
"CLIMDIV": 2906,
"NAME": "CENTRAL HIGHLANDS",
...
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[ -105.14900200004166, 32.63999899975494 ],
[ -105.22300000044908, 32.5630000003506 ],
...
]
]
}
},
...
]
}
... we will want to carefully notice that the path to the identifier we are interested in (relative to each feature) is properties.CLIMDIV
- that is, for each Geo feature, there is a properties
object, and that object has a nested CLIMDIV
that will match an identifier in our timeseries database. On that note, let's further assume that we expect data coming from our timeseries database to have the tag clim_div
relating to the climate division number for the series, like so:
temperature,units=degrees_f,clim_div=2905
temperature,units=degrees_f,clim_div=2906
...
... then our setup would look like the following:
Tab | Setting | Value |
---|---|---|
Metrics | GROUP BY | tag(clim_div) |
GeoLoop | Map Data Options > Series GeoID Tag | properties.CLIMDIV |
GeoLoop will join the query results up with the GeoJSON data based on these two settings.
Visualization Options
Here is where you configure the animated display preferences. Do you want the Lines/Points to vary in size? What about color? These Options are here.
Animation Speed / Looping Options
Not yet implemented. Have something to contribute? PRs are welcome!
Special Notes
This work borrows heavily from the great work in grafana-worldmap-panel
. While both plugins display maps, this one was developed specifically to play an animation of how geographic properties change over time.
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
.h4 . .mb-0 }
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Installing GeoLoop on Grafana Cloud:
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
For more information, visit the docs on plugin installation.
Installing on a local Grafana:
For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.
1. Install the Panel
Use the grafana-cli tool to install GeoLoop from the commandline:
grafana-cli plugins install
The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.
Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.
2. Add the Panel to a Dashboard
Installed panels are available immediately in the Dashboards section in your Grafana main menu, and can be added like any other core panel in Grafana.
To see a list of installed panels, click the Plugins item in the main menu. Both core panels and installed panels will appear.
Changelog
v1.1.2 (WIP / to-do)
- add legend with value keys
- add looping controls (speed, pause, ...)
- make the time-legend less ugly
v1.1.1
- fixes some weird issues with refreshing maps while changing options
- fixes a panel error if no location tag is specified
- fixes the previously-useless "allow pan/zoom" control
v1.1.0
- Allows dot-separated path to geojson property
v1.0.0
- First functional release