carto-geocoding
Original:🇺🇸 English
Translated
Builds geocoding workflows in CARTO that convert street addresses or place names into geographic coordinates. Triggers when the user mentions geocoding, address to coordinates, address resolution, geolocate addresses, "add geometry from addresses", lat/lon from address, place name to point, address matching, forward geocoding, converting addresses to points, or has tabular data with address columns but no spatial geometry column and needs to create one.
12installs
Sourcecartodb/agent-skills
Added on
NPX Install
npx skill4agent add cartodb/agent-skills carto-geocodingTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Geocoding Addresses in CARTO Workflows
Converts street addresses or place names into geographic coordinates (point geometries). This is an essential first step when working with tabular data that has an address column but no spatial column.
Prerequisites: Load for the development process, JSON structure, and validation commands.
carto-create-workflowInstructions
A geocoding workflow follows this pipeline:
Source Table (with address column) -> Geocode -> (Filter successful) -> SaveStep 1: Load Source Data
Use . The input table must contain a column with address strings (e.g. , , ).
native.gettablebynameaddressfull_addresslocationSuccess: Node outputs a table with at least one text column containing address data.
Step 2: Geocode
Use with:
native.geocode| Input | Description | Required |
|---|---|---|
| Table with address data | Yes |
| Column containing the address string | Yes |
| Country filter to improve accuracy (e.g. | No, but strongly recommended |
The address column can contain full addresses () or composite values built from multiple columns (concatenate street + city + postal code in a prior step).
"123 Main St, Springfield, IL 60001"native.selectexpressionTwo output handles: The geocode component produces two separate outputs:
- : Rows where geocoding succeeded -- a
matchcolumn with point geometry is added, plus ageomJSON column with quality info (confidence score, match type).CARTO_GEOCODE_METADATA - : Rows where geocoding failed --
unmatchis NULL.geom
Connect downstream nodes to the correct handle based on your needs.
Success: The geocode node is configured with the address column and (ideally) a country filter. Edges connect to the and/or output handles.
matchunmatchStep 3: Filter or Review Results (optional)
For the match output:
- Optionally filter by confidence using the metadata column (e.g. extract confidence from via
CARTO_GEOCODE_METADATA).native.selectexpression
For the unmatch output:
- Save to a separate table for review and manual correction.
- Common failure causes: typos, incomplete addresses, PO boxes, ambiguous place names.
Success: High-confidence geocoded rows are isolated; failed rows are captured for review.
Step 4: Save Results
Use to persist the geocoded output. The column contains WGS84 (EPSG:4326) point geometries, ready for visualization in CARTO Builder or further spatial analysis.
native.saveastablegeomSuccess: Validated workflow that can be uploaded via .
carto workflows createGeocoding Under the Hood
The workflow component wraps the CARTO Analytics Toolbox function , which:
GEOCODE_TABLE- Adds a column with point geometry to each row
geom - Adds a JSON column with quality information (confidence, match type)
CARTO_GEOCODE_METADATA - Uses CARTO Location Data Services (LDS) -- each geocoded row consumes LDS quota
Check available quota by querying the Analytics Toolbox function. The fully-qualified name is provider-specific (BigQuery: ; Snowflake: ; Databricks: stored procedure in the dedicated AT schema). Load and consult for the AT path on your warehouse.
LDS_QUOTA_INFO()`carto-un.carto`.LDS_QUOTA_INFO()CARTO.CARTO.LDS_QUOTA_INFO()carto-create-workflowreferences/providers/<provider>.mdGotchas
- Geocoding consumes LDS quota. Each row geocoded counts against the account's Location Data Services quota. Check quota availability before bulk operations, especially on large tables.
- Two output handles: and
match. Don't connect to the wrong one --unmatchhas geometries,matchhas NULLs. If you connect theunmatchhandle to a spatial operation, it will fail.unmatch - Country filter is strongly recommended. Without it, ambiguous addresses may resolve to the wrong country (e.g. "Springfield" exists in 30+ US states and in other countries). The country parameter improves both accuracy and speed.
- Address formatting matters. Well-formatted addresses produce better results: works better than
"123 Main St, Springfield, IL 60001". Include city, state/region, and postal code when available."123 main street springfield" - Provider casing & SQL dialect. Examples in this skill use lowercase column names (BigQuery / Databricks / Postgres / Redshift convention); on Snowflake unquoted identifiers surface UPPERCASE (e.g. ,
CARTO_GEOCODE_METADATA). When writing dialect-specific SQL or referencing the AT path, seeGEOM.carto-create-workflow/references/providers/<provider>.md - For large tables, consider batching. Geocoding hundreds of thousands of rows in a single run can exhaust quota or time out. Split into batches if needed.
- Output geometry is always WGS84 points. The column contains EPSG:4326 point geometries regardless of the input address format or country.
geom - Failed geocodes deserve review. The output is not just noise -- it often reveals data quality issues (missing postal codes, abbreviated city names, non-standard formatting) that can be fixed and re-geocoded.
unmatch
Reference Templates
Academy tutorials and workflow templates covering geocoding:
| Resource | Description | URL |
|---|---|---|
| Geocoding (BigQuery AT) | Step-by-step geocoding with Analytics Toolbox for BigQuery | Academy link |
| Geocoding (Snowflake AT) | Step-by-step geocoding with Analytics Toolbox for Snowflake | Academy link |
| Workflow template: Geocode street addresses | Generating new spatial data from addresses | Academy link |
Common Variations
| Variation | How |
|---|---|
| Composite address from multiple columns | Add a |
| Geocode + spatial join | Chain: Geocode -> match -> Spatial Join (e.g. point-in-polygon to assign regions) |
| Geocode + enrichment | Chain: Geocode -> match -> Buffer/Isochrone -> Enrich (add demographics around each geocoded point) |
| Capture failures for re-processing | Connect both |
| Filter by confidence | After geocode, use |