Grafana includes a WorldMap visualization so you can see geospatial data overlaid on a map. This can be helpful to understand how data changes based on its location.
This section visualizes taxi rides in Manhattan, where the distance traveled was greater than 5 miles. It uses the same query as the NYC Taxi Cab tutorial as a starting point.
In your Grafana dashboard, create a new panel, select
New Visualization
, and selectWorldmap Panel
.Navigate to the
Queries
tab.Select your data source.
In the
Format as
dropdown, selectTable
. ClickEdit SQL
and enter the query you want to use. This examples uses this query:SELECT time_bucket('5m', rides.pickup_datetime) AS time,rides.trip_distance AS value,rides.pickup_latitude AS latitude,rides.pickup_longitude AS longitudeFROM ridesWHERE $__timeFilter(rides.pickup_datetime) ANDST_Distance(pickup_geom,ST_Transform(ST_SetSRID(ST_MakePoint(-73.9851,40.7589),4326),2163)) < 2000GROUP BY time,rides.trip_distance,rides.pickup_latitude,rides.pickup_longitudeORDER BY timeLIMIT 500;Configure the visualization by navigating to the
Visualization
tab. Make sure theMap Data Options
are set totable
andcurrent
.In the
Field Mappings
section, set theTable Query Format
toTable
.Map the
Latitude Field
to thelatitude
variable, theLongitude Field
to thelongitude
variable, and theMetric
field to thevalue
variable.In the
Map Visual Options
section, set theMin Circle Size
to1
, and theMax Circle Size
to5
.In the
Threshold Options
section, set theThresholds
to2,5,10
. This automatically configures a set of colors, which you can adjust later.
Keywords
Found an issue on this page?Report an issue or Edit this page in GitHub.