This content applies to a previous version of CARTO
In October 2021 we released a new version of our platform. You can find the latest documentation at docs.carto.com
Managing Your Data with CARTO Editor
Learn how to manage your data with CARTO Editor.
While you can apply many styling options with the CARTO Editor, you can also geocode your data and run several types of queries to manage and visualize your data.
Geocoding Data
CARTO understands that geocoding is essential to data management. You can edit your dataset (or map) and apply geocoding coordinates to transform your data.
Editing Geocoded Data
- Visit the Data page and click on a dataset.
- Select Georeference from the Edit drop-down menu.
The georeference options appear.
- Select the georeference data category.
| Georeference Category | Description |
|---|---|
| Long/Lat Columns | Select the specific longitude and latitude column from the drop-down menu. |
| City Name | Select the column where your city names are stored. You can also indicate the administrative region and country. |
| Admin. Regions | Select the column where your region names are stored. |
| Postal Codes | Select the column where your postal codes are stored. You can also indicate the country. |
| IP Addresses | Select the column where your IP Addresses are stored to convert them into geographical locations. |
| Street Addresses | Select the column where your street addresses are stored. Street address geocoding consumes credits from your account. |
- Click CONTINUE to save and apply the georeference data coordinates.
cartodb_georef_status Column
As a result of geocoding your data, the cartodb_georef_status column appears in your Data View. It displays the boolean status of your geocoded data for each row.
cartodb_georef_status | Description | Geocoding Process |
|---|---|---|
| True | The row has been geocoded successfully. | The row is not geocoded if a new geocoding process is run. |
| False | The row has not been geocoded. | The row is geocoded if a new geocoding process is run. |
| Null | Neutral status, as if the column does not exist. | Null values are geocoded by default. |
Running SQL Queries
CARTO enables you to query data using the Structured Query Language (SQL). The platform provides particular support for PostGIS SQL commands, which allows you to filter data spatially.
To run an SQL query in the CARTO dashboard, open a dataset or map. In the righthand sidebar, click the SQL icon. By default you will see:
SELECT * FROM dataset_name
You can modify this query and then hit the “Apply query” button or press cmd + s on Mac OS or ctrl + s on Windows. An example:
SELECT * FROM ne_10m_populated_places_simple WHERE featurecla = 'Admin-0 capital'
Dataset from Query
It is possible to create a new dataset from an SQL query.
- After applying your modified SQL query, create dataset from query or clear view appears.
- Click create dataset from query.
- CARTO will create the dataset from the query, and load the results.
Merging Data
Merge your current dataset with another existing dataset by performing a column join or a spatial join.
Merge by Column Join
Column joins are useful if you have two datasets that share a common row value. For example, country level datasets often contain an ISO code for each row.
- Click your Data page from the dashboard menu.
- Select the name of the dataset that you want to merge column values with.
- Select Merge with dataset from the Edit drop-down menu.
- Select Column join.
- Choose the merge columns from each dataset.
- Click MERGE DATASETS.
Merge by Spatial Join
Spatial joins merge two datasets based on a number of intersecting geospatial records. Spatial joins are performed by applying operators (SUM, COUNT, AVG).
| Operator | Description |
|---|---|
| SUM | Adds together values in a numeric column for all intersecting records. |
| COUNT | Calculates the number of intersecting records. |
| AVG | Provides the average value of a column for all intersecting records. |
- Click your Data page from the dashboard menu.
- Select the name of the dataset.
- Select Merge with dataset from the Edit drop-down menu.
- Select Spatial join.
- Choose the merge columns and select the calculation operator.
- Click MERGE DATASETS.
Export data
You can export any of your datasets for use offline. The Export option is available from the Edit menu when a dataset is selected.
- Visit the Data page.
- Click on the name of a dataset.
- Select Export from the Edit drop-down menu.
- Select the preferred file format.
Supported formats: CSV, Shapefile, KML, GeoJSON, and SVG.
Tip: If you are using the SQL API, you can use your table URL to run a response query and export downloads in different formats:
https://{username}.carto.com/api/v2/sql?format=csv&q=SELECT+*+FROM+tm_world_borders_sim
