Tag: Tile Map

Kibana is the tool developed by the Elastic team that allows you to explore and visualize your data stored in Elasticsearch. It provides some different type of chart and in this post we are going to see how use the tile map chart.
A tile map displays a geographic area overlaid with circles keyed to the data determined by the buckets you specify.

In this post we will use the data coming from the web site bandaultralarga. It is a web site managed by the Italian government that allows to see the strategy of distribution of the broadband connection (optical fiber 30MB or 100MB) among the Italian territory during the next years and see the current situation.

I am going to use the data of the region Lombardia. You can download the data here (OpenData IODL 2.0 license).

We will build a heat map showing the current distribution of the 100MB band around the region.

For each data instance we will consider the following fields:

NomeProvincia: the name of the province for a given city

NomeRegione: the name of the region for a given city (in this example off the cities will be in the region Lombardia)

NomeComune: name of the city

oggi_100: current percentage of the city covered by 100MB band

geo: latitudine and longitudine of the given city

This is an example of data instance that we are going to store on Elasticsearch:

1

2

3

4

5

6

7

{

"NomeProvincia":"Milano",

"NomeRegione":"Lombardia",

"nomeComune":"Albairate",

"oggi_100":12.32,

"geo":"45.4219508688,8.94546643473"

}

I created a new Elasticsearch index called networkcoverage and I posted a new mapping called city:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

curl-XPUT http://192.168.193.130:9200/networkcoverage -d '

{

"mappings":{

"city":{

"properties":{

"NomeProvincia":{"type":"string","index":"not_analyzed"},

"NomeRegione":{"type":"string","index":"not_analyzed"},

"nomeComune":{"type":"string","index":"not_analyzed"},

"oggi_100":{"type":"float"},

"geo":{"type":"geo_point"}

}

}

}

}

';

As you can see the type of the geo field is geo_point. This data type is the one used to store geo based points. For the geo_point data type, the following formats are supported:

Lat Lon as Properties

1

2

3

4

5

6

7

8

{

"pin":{

"location":{

"lat":41.12,

"lon":-71.34

}

}

}

Lat Lon as String

Format in lat,lon.

1

2

3

4

5

{

"pin":{

"location":"41.12,-71.34"

}

}

Geohash

1

2

3

4

5

{

"pin":{

"location":"drm3btev3e86"

}

}

Lat Lon as Array

Format in [lon, lat], note, the order of lon/lat here in order to conform with GeoJSON.

1

2

3

4

5

{

"pin":{

"location":[-71.34,41.12]

}

}

I represented the latitudine and longitudine as string so “41.12,-71.34” and loaded the data instances using the bulk API.

1

curl-XPUT192.168.193.130:9200/_bulk--data-binary@geoData.json

Now that the data are stored in Elasticsearch we can open the Kibana panel and under the visualize section create a new tile map.

To add a geo coordinates buckets just select the field that contains the coordinate information (in this example the geo field).

We are interested in the current 100MB band distribution, so as metric we are going to select the max of the field oggi_100.

With this visualization, we can clearly see where the band distribution is high but we do not see the points where the percentage is really low (this because the dots on the map are really small).
To avoid this we need to set some chart options.

In the option tab of the chart, change the map type to Shaded geohash grid to visualize a grid instead of circle and solve the issue previously described.

We built a heat map that shows the 100MB band distribution among the region Lombardia, the darker color represents the areas where the percentage of territory covered by 100MB band band is higher.

I played a bit with Kibana and I created a dashboard where is it possible to filter the map by province or city.

This is the final result:

We can filter the map by province (in the example I selected the Bergamo province):

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. If you want to know more or withdraw your consent to all or some of the cookies, please refer to the coockie policy. Got it!Reject.