Drupal 8 is a powerful and customizable CMS.
It provides a lot of different tools to add, store, and visualize data, however spatial data visualization is a sophisticated and complicated topic — and Drupal hasn't always been the best option for handling it.
Because of its complexity, spatial data requires a specific process to become visual. We often think of a map with some pins or location points, but there are much more complex edge cases where Drupal is not able to solve the end user needs, such as rendering thousands of points or complex geometries in a map, or trying to create heatmaps based on stored data.
That’s why it's important to acknowledge that Drupal is not a golden hammer and the use of third party services will help us to provide a much better and appropriate user experience. This is where we introduce CARTO.
CARTO is a powerful spatial data analysis platform that provides different services related to the geographical information stored in a spatial database in the cloud. The fact that the base of all this process is a database table makes the connection between Drupal and CARTO simple and fairly straightforward.
From our point of view, two of the most useful tools provided by CARTO to be integrated within Drupal are the Import API and Builder. (There are some other ones that are interesting for more advanced users).
- Import API allows you to upload files to a CARTO account, check on their current upload status, as well as delete and list importing processes on a given account.
- CARTO Builder is a web-based drag and drop analysis tool for analysts and business users to discover and predict key insights from location data. Maps generated with this tool can be shared or embedded in any website.
So, at this point we have two systems — Drupal and CARTO — with the following features:
- Drupal, a very capable tool to create, store, and establish relationships between content
- CARTO, a powerful platform able to import spatial data, process it and generate amazing performance maps that can be shared
- Drupal Media, an ecosystem that allows embedding and integrating external resources as entities
The problem is generating powerful maps and including them in any Drupal site.
First, the data stored in Drupal has to be pushed to CARTO. Then the maps are generated in CARTO before being embedded in Drupal.
This can now easily be done using CARTO Sync and Media entity CARTO, both Drupal modules.
- CARTO Sync allows Drupal Views to generate who's results can be pushed to CARTO to be processed
- Media Entity CARTO integrates CARTO Builder shared maps within the Media ecosystem and allows to create Map entities to be referenced or embedded in any Drupal content
Following this method, we can still use Drupal as the CMS, while taking advantage of all the features that CARTO provides in order to represent accurate spatial information.
If you find this topic interesting, please take a look at the slides or recording from the presentation at DrupalCamp Madrid 2017.