Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Importing data

CARTO allows you to import data from local files or URLs. This functionality is currently supported for the following Data Warehouses:

To import data into Amazon Redshift in Self-Hosted environments, you'll first need to configure your own S3 Bucket in Settings.

Importing into Databricks stages the data through a Unity Catalog volume. The connection needs permission to write to (and, if it doesn't exist yet, create) the staging volume. See the Databricks connection documentation for details.

To import your data, go to Data Explorer and click the Import data button in the top right corner (or the import data icon if you have a connection or folder selected).

A new dialog will open where you can choose between uploading a local file (from your computer) or from a URL. Once you have selected your file, click Continue to select the location and name of the output table.

CARTO will define the schema of the resulting table by default, but you can turn the toggle off to manually define the schema. Custom schema definition might be needed in some cases. For example, postal codes are often interpreted as numbers when they should be strings. For more information on manual schema definition, check Defining a custom schema.

Once you have selected the location and table name, click Import to import your data. After importing, the table will be available in your selected connection. You can preview it in Data Explorer or create a map using Builder.

Write permissions

In order to import data, your connection needs to have write permissions on the chosen destination. If the connection does not the required permissions, a warning will appear. Read more about why we require certain permissions on connections.

Supported formats

CARTO supports importing CSV, GeoJSON, GeoPackage, KML, KMZ, TAB, Shapefiles (in a .zip package), GeoParquet, FlatGeobuf (.fgb), and File Geodatabase (a .gdb folder zipped as .gdb.zip) files. These formats can be imported into any connected data warehouse.

You can also import an ArcGIS Feature Service or Map Service layer from its URL, for example https://<host>/arcgis/rest/services/<name>/FeatureServer/0. Point at a specific layer (ending in /0, /1…) so CARTO can page through large layers.

GeoTIFF raster files are also supported when importing into BigQuery, Snowflake, and Databricks connections. The resulting table follows the Raquet specification.

The size limit for file imports is 5 GB for all formats.

Imported files must contain at least two columns.

To learn more about advanced raster imports, see our section on importing raster files using the raster-loader python utility.

For CSV files, CARTO will try and autodetect the geometry column or create the geometries from latitude/longitude columns. The supported column names are:

  • For geometry: geom,Geom,geometry,the_geom,wkt,wkb

  • For latitude: latitude,lat,Latitude

  • For longitude: longitude,lon,Lon,Longitude,lng,Lng

The expected delimiters are: comma (,), semi-colon (;) or a tabulation.

RGB images

CARTO stores the three bands of an RGB image together and compresses them as WebP, which makes the table much smaller and faster to show on a map. WebP is lossy, so the stored values are close to the original ones, but not identical.

To analyze an RGB raster, remove the red, green and blue tags from the file before importing it. This doesn't change the pixel values. For example, with GDAL:

CARTO then imports each band separately, without lossy compression.

Manually defining schema

As explained above, you can choose between letting CARTO automatically define the schema for the output table or you can manually define it yourself. When manually defining a schema, here are the most important things to take into account:

  • The options available for each column are the native data types available for the destination data warehouse (eg: Google BigQuery, Snowflake...)

  • Object-like data types such as RECORD, STRUCT, ARRAY or OBJECT are not supported.

  • When using a custom schema, error tolerance will be 0.

To define a custom schema, just make sure to disable the Let CARTO automatically define the schema switch.

Error tolerance

By default, CARTO will work with the destination data warehouse to try and avoid failing an entire import process if only a small subset of rows are failing. This means that for a file with 10,000 rows, if one row fails, CARTO will successfully create a table with the remaining 9,999 rows.

This is the default error tolerance for each destination data warehouse:

  • BigQuery and CARTO Data Warehouse: up to 1,000 rows

  • Snowflake: unlimited rows

  • Redshift: up to 1,000 rows

  • PostgreSQL: 0 rows (importing will fail if a row throws an error)

Imported with warnings

Sometimes an import finishes but some of your rows are left behind, either because they exceeded the error tolerance above or because their geometry could not be read. When this happens, the job finishes as Imported with warnings instead of a plain success, and an amber marker appears next to it in the jobs panel.

Click the job to see how many rows were affected and why:

  • Imported without location: the row was imported, but its coordinates could not be read. It can still be queried, but it won't appear on maps.

  • Couldn't be imported: the row was dropped because of a formatting error, so it is not in the table.

The same warnings appear in the CARTO CLI and the Imports API, where the job status is reported as completed_with_warnings.

Region-related errors

If your data warehouse is established on a different cloud region than your CARTO Cloud organization, imports might fail. This depends on limitations and setup on each data warehouse and cloud provider, and are not set by CARTO.

Last updated

Was this helpful?