Spatial data management and analytics with CARTO QGIS Plugin
The CARTO QGIS Plugin seamlessly integrates desktop GIS workflows with cloud-native spatial analytics, allowing users to connect, access, visualize, edit, and sync spatial data from data warehouses between QGIS and CARTO.
While CARTO excels in analytics and visualization of large-scale geospatial data running natively on cloud data warehouse platforms, certain data management tasks—such as geometry editing and digitization—are better suited for desktop GIS tools like QGIS.
In this tutorial, you will learn how to use the CARTO QGIS Plugin to enhance your geospatial processes. Using a telecom network planning example, you will connect QGIS to your data warehouses through CARTO, edit geometries based on an image provided by the urban department, and sync updates seamlessly with CARTO. Finally, you will create an interactive map to review potential sites alongside relevant datasets while keeping the information updated as new edits are made in QGIS.
By the end of this tutorial, you will have a fully integrated process between QGIS and CARTO, ensuring efficient spatial data management in a cloud-native environment.
Important considerations:
In this tutorial, we will be using:
QGIS Version: 3.34.15-Prizren
CARTO QGIS Plugin Version: 0.92.2
Step-by-Step Guide:
In this guide, we'll walk you through:
Installing the CARTO QGIS Plugin
To get started, install the CARTO QGIS Plugin in your QGIS Desktop application. If you don't have QGIS yet, it is an open-source GIS desktop application that can be downloaded here.
Open QGIS desktop and start a new project.
Navigate to Plugins > Manage and Install Plugins.
Click on the Not Installed tab and search for "CARTO".
Select CARTO QGIS Plugin and click Install.
Once installed, you should see the CARTO Plugin in the top toolbar and the Browser panel.
Authorizing CARTO in QGIS
Now, you need to log in to your CARTO account to connect your cloud-hosted spatial data with QGIS.
Locate the CARTO Plugin in the QGIS interface (in the Plugins section or Browser panel).
Click on Log In to CARTO.
Enter your CARTO credentials to securely authenticate your account.
If you don't have a CARTO account yet, you can sign up for a free trial.
After successfully logging in, a confirmation screen will appear, indicating that the CARTO QGIS Plugin is now connected and ready for use.
Browsing and accessing your data
With CARTO authorized, you can now browse and load datasets from your cloud data warehouse directly into QGIS.
In the QGIS Browser panel, locate CARTO Connections. If you don’t see your Browser, activate it via View → Panels → Browser.
You’ll see your available datasets and tables from your organization’s data warehouse.
Click on a dataset to preview its structure and metadata.
You can download the entire table or apply filters (WHERE statements, spatial filters, row limits)
Permissions:
Your ability to edit datasets depends on your user permissions in your data warehouse.
If you don’t have an editable table to follow this tutorial, you can create one or import sample data using CARTO’s import functionality, either to your own connection or to the Private dataset in CARTO Data Warehouse.
Georeferencing images in QGIS
In some cases, geospatial data is unavailable, and all you have is an image or a scanned document. This is where QGIS’s georeferencing capabilities become essential.
In this scenario, you’ve received a PDF containing a newly proposed redevelopment site, which needs to be added to the list of potential sites for review next year. Since this redevelopment area comes from the urban department, there is no existing geospatial dataset available—only a .png image of the site.
Take a screenshot of the above image and save it as .png.
Add your image as a Raster layer:
Click on Data Source Manager → Raster.
Upload the .png image.
Click Add to display it in QGIS.
Click Zoom to Layer(s) to confirm the image was added.
Use the Georeferencer tool:
Go to Layer → Georeferencer.
In the Georeferencer modal, add the raster image.
The image will now appear in the Georeferencer canvas.
Define control points:
Select Add Point and mark at least four control points.
Click Map Canvas to introduce coordinates.
Click on the correct location in the main map canvas.
Run the Georeferencing process:
Define an output file name and set transformation settings.
Click Run to execute.
The georeferenced raster file will now appear in the correct location.
Editing geometries and pushing changes to your data warehouse
Now, we will edit an existing CARTO table to include the newly digitized site for network expansion planning.
In the QGIS Browser, locate an editable table (e.g.,
planned_regions_2025
) within your CARTO connection.
Click Add Layer or use Add Layer Using Filter if you want to download a subset of your data.
Once loaded, start an editing session by clicking the pencil icon in the Editing Toolbar.
Use the Add Polygon tool to digitize the new redevelopment site.
Once finished, right-click to complete the geometry.
Enter the feature attributes (e.g., site name, classification, priority).
Click Save to upload the changes back to your data warehouse through CARTO. If your table does not contain a geoid storing a unique identifer, you'll be prompted with a modal to define your primary key. Please make sure this stores a unique identifer so your edits can be successfully and correctly uploaded.
Go to your CARTO platform, naviage to CARTO Data Explorer to confirm the uploaded feature. The new Port Lands Redevelopment site should now appear.
Extracting insights using CARTO Builder
Now that your data is synchronized and available in your data warehouse, you can leverage the powerful features of the CARTO platform to create interactive and insightful dashboards.
In CARTO Workspace, navigate to Data Explorer and locate your table. In here you should be able to have a preview of both the data and the map. From this interface, click on Create map. This will open a new tab with Builder displaying this data source.
Builder is CARTO map-making tool that allows you to create scalable web map applications leveraging the data warehouse capabilities. Let's create our interactive dashboard.
Let's give your map a name, "Toronto - Planned regions for 2025".
After that, we'll rename our layer to "Planned Regions" and style them accordingly so the regions stand out on the map visualization. In our case, we'll set the Fill Color and Stroke Color to
light and dark orange
. Then, set the Stroke Width to2.
Let's add Toronto's census data source. To do so, follow the next steps:
Select the Add source from button at the bottom left on the page.
Select Custom Query (SQL) and then Type your own query under the CARTO Data Warehouse connection.
Click on the Add Source button.
The SQL Editor panel will be opened. To add Toronto's census data source, run the query below:
Rename the newly added layer to "Census population" and set the Fill Color based on
Total_population
property using alight to dark blue
palette. Set the Opacity for the Fill Color to20
and the Opacity for the Stroke Color to10
.
In the main layer panel, change the position of the layer to the bottom, so that Planned regions layer stay on top of the visualization.
Now, we'll add a final dataset, the road network for Toronto, to have visibility on the major roads that are likely to be impacted by this project. To do so, add a custom SQL query and run the following query, as per previous source. This query contains a
WHERE rank < 5
that will allow us to dynamically obtain just major roads in this location.
Name this layer "Road network" and style the Stroke Color based on its
Rank
property, fromlight to dark pink
. Also, set the Opacity to40
.Then, set the Stroke Width to2
.
We have now finished adding our sources, now let's add some functionality to our dashboard that will allow users to dynamically extract information by leveraging pop-up interactions and charts.
Navigate to the Interactions section, and set the properties for each layer as below:
Road Network:
name
type
rank
Planned regions:
All
Census Population:
Total_population
Now let's include some Widgets to extract insights and allow users to filter data. To do so, navigate to the Widgets tab and include the following widgets:
Formula Widget:
Source:
Census population
Widget name:
Total Population
Operation:
SUM(Total_population)
Formatting:
12.3k
Behaviour:
Filter by viewport
Pie Widget:
Source:
Planned regions
Widget name:
Region Status
Operation:
status
Behaviour:
Filter by viewport
Category Widget 1:
Source:
Planned regions
Widget name:
Region Name
Operation:
Region_name
Behaviour:
Filter by viewport
Category Widget 2:
Source:
Road network
Widget name:
Road Network Type
Operation:
Type
Behaviour:
Filter by viewport
Before publishing our map, we'll configure our Data Sources Freshness. The data source freshness will determine how up-to-date the data sources in the map are at its initial load. This will ensure users will be able to extract insights always as fresh as you configure this. In our case, we'll set Data Freshness to
5 minutes
. So if further changes are done, for example more sites are digitized in QGIS using CARTO QGIS Plugin, they will reach our map automatically once is loaded.
Finally, we're ready to share the map with others. Let's go to the Preview mode, to ensure the map is looking as expected. To do so, click on Preview next to the Share button. A different layout appears that displays the application as if you were the end-user accessing it.
Once you are happy with the dashboard, click on Share and set it to shared with your specific users, SSO groups, your entire organizaiton or publicly.
Congrats, you're done! The final results should look similar to the below:
Learn more about crafting impactful visualizations in the Building Interactive Maps section of the Academy.
Last updated
Was this helpful?