Maps: Geospatial Analysis

Share:

Kibana Maps simplifies the way you analyze and comprehend geographical data in the context of Elasticsearch data. It can be used to make data-rich maps that offer geospatial context and provide insights. This tutorial will take you through an exposition of how Kibana Maps can be put into practice for effective geospatial analysis.

We'll begin by adding sample data. In Kibana, from the home page, click on "Add sample data". This will populate your Elasticsearch cluster with some sample data. For this tutorial, let's select the 'Sample flight data', which includes geo-position attributes (longitude and latitude). This data will give us a comprehensive landscape for performing geospatial analysis. If we imagine each flight as a movie character travelling from one place to another, we can use this data to provide rich mapping and visual story-telling.

Creating a new Map

To create a Map in Kibana, follow these steps:

  • Navigate to Maps on the Kibana sidebar.
Kibana > Maps
  • Click 'Create Map', you will be in a blank map environment.

Adding Layers

Maps in Kibana are constructed in layers, enabling complex visualizations. In our imaginary movie world, each layer could represent a different character’s travels.

To add a new layer, click on the ‘Add layer’ button. This presents you with options for data sources. For this demonstration, we'll select 'Elasticsearch documents', this implies that we'll be pulling our data directly from Elasticsearch.

Next, we'll select the 'kibana_sample_data_flights' index pattern. We’ll leave the default settings for the scaling and filtering options. In terms of our movie example, index patterns represent the route each character has taken, So, in this case, 'kibana_sample_data_flights' is the route of character flight.

Index pattern: kibana_sample_data_flights

Setting Geospatial Fields

Select the ‘Add’ button, and you’ll be presented with the layer setting options. Ensure that you have chosen the correct 'GeoPoint' field - this should be 'DestLocation'. We're going to plot the destination location of each of these flights.

One of the most interesting aspects of using Kibana Maps is the ability to style your data depending on variables. In our movie world, we can style the map points based on the character flights' properties like cost or destination duration, giving us a visually distinct analysis.

To establish clear visualization, we can set the color of the destination points based on the price of the flight:

In the left menu under 'Layer Style', click the button under 'Fill color'. Select the 'By value' tab and set the field to 'AvgTicketPrice'. Keep the color ramp default.

Layer Style > Fill color > By value (field: AvgTicketPrice)

Finally, click on 'Save & close'. The map now displays various colors dependent on the average ticket price of the flights.

Adding another layer

If we want to add additional geospatial layers for another character, this can be done easily in Kibana. Repeat the process of adding a layer, selecting data source and setting geospatial fields. For instance, we could add a layer for the origin location of flight of another character using the 'OriginLocation' field.

Now, our map not only shows us the end location of different characters' flights but also their starting points, providing a complete picture.

Creating Filters

The beauty of Kibana Maps lies in its ability to facilitate dynamic interactions with data. For instance, you could filter flights based on different characters or any other attribute in the data.

You can use the filter bar to add filters and queries. Just type out your filter in the command bar located at the top, e.g. Carrier: "Kibana Airlines" and then hit Enter. Your map will update accordingly. This can allow you to focus on specific aspects of your data.

In our movie scenario, if we wanted to track the movement pattern of a particular character, we would just put a filter on the character in the command bar, and it would display only that character's movement pattern.

One powerful feature is that your map is fully interactive – you can zoom in and out, and move around with just a mouse drag. Hovering over a point will provide more details about it, offering rich insights into your Elasticsearch data.

Keep in mind, if you zoom out too far or have too much data in your indices, some features might be hidden due to data clustering. You can adjust this clustering in the layer settings by disabling the Scaling Type, allowing for more detailed analysis at larger scales.

Hopefully, this tutorial has provided a basic understanding of using Kibana to create beautiful and rich geospatial visualizations. To delve deeper, Kibana also supports advanced features such as creating region maps, adding custom vectors, coordinate maps and using Tile Map Service (TMS).

0 Comment


Sign up or Log in to leave a comment


Recent job openings