🧑‍🍳Prepare geo data (with basemap)

Introduction

In order to create a mapchart, the dataset used to create the chart must include a geographical column that give information about the polygon corresponding to a zone. So within this page, we will see more in detail the pre-requisite in term of data preparation that will allow the creation of a mapchart.

When building a mapchart, the geographical column will be automatically used in order to build the chart. There is no need to specify it, but it's mandatory to have this geographical column.

Generally, for a mapchart building purpose, you will need:

  • 1 basemap file (geojson format): file contaning the geographical polygon of a label (for example regions, countries, ...)

  • 1 datasource / dataset containing your measure and dimension

  • Depending on the need in term of data preparation, there are some YouPrep steps that are dedicated for geographical data.

The overall process is simple:

  • Import the basemap file (it should have the extension geojson)

  • Create a dataset containing your measure and dimension

    • Join the basemap dataset

  • (Make some data transformation)

  • Create a mapchart using the dataset containing your measure, dimensions, and geographical column

Example of a complete process

  • Import the basemap file in Toucan.

Generally the file will contains a list of geographical label (e.g Country, Region, ...) with associated geographical polygons (column geometry in the example below).

  • Create a new dataset containing all the measures & dimensions, and JOIN the basemap dataset to your dataset with YouPrep. In the example below, we join the dataset containing geographical column (basemap_france) to our dataset, by using the key Departement

  • After having join the basemap dataset, you should see new column coming from the joined dataset, and most importantly you should find your column contaning the geographical data (geometry in the example) that has the correct column type (geo).

  • You can also make some data transformation that are specific to geographical data

  • Then, save the dataset.

The dataset is now ready to be used in order to create a mapchart.

So, you can now easily create a mapchart (look at the mapchart documentation more detail) using the dataset you just created.

Last updated