data-services/geocoder
2022-03-25 16:24:25 +00:00
..
admin0 Add new SQL patch adding aliases for 'North Macedonia' 2021-01-18 17:48:36 +00:00
admin1 Fix typo regarding 'Haut-Rhin' region 2022-03-25 16:24:25 +00:00
available-services Create LICENSE.md 2015-11-06 16:11:06 +01:00
extension Some more changes in the Make file 2018-03-26 13:24:34 +02:00
ip-addresses Final instructions 2018-05-11 12:53:45 +02:00
namedplace carto 2016-07-11 10:44:25 +02:00
postal-codes update french postalcode table name 2015-12-02 13:27:37 -05:00
setup Update response-types.sql 2015-12-01 15:19:16 +01:00
.gitignore Add new patch to include new synonyms for Swaziland 2018-10-11 18:15:50 +02:00
carto-package.json Changes in component name and semver specification 2018-08-17 11:03:45 +02:00
CONTRIBUTING.md Update CONTRIBUTING.md 2016-06-22 15:45:30 +02:00
geocoder_apply_patches.sh Add download and apply patches 2016-06-22 14:47:33 +02:00
geocoder_download_dumps wget parameter to resume downloads 2016-02-18 14:05:20 +01:00
geocoder_download_patches.sh Fix typo regarding 'Haut-Rhin' region 2022-03-25 16:24:25 +00:00
geocoder_restore_dump Remove single-transaction flag from restore dumps script 2015-11-06 15:38:17 +01:00
LICENSE.md Update LICENSE.md 2015-11-06 16:34:13 +01:00
README.md CARTO 2016-07-11 10:41:45 +02:00

CARTO Internal Geocoder

API Response Format

Parameters

Field Explanation Type
q Input query text text
success Was it successfully geocoded? boolean
geom Resolved geometry, NULL if none wkb
c Input country text if provided and variable text
  • q will be searched on in lowercase but returned in input form
  • c will always be returned in the form it was given, including empty string and NULL
  • c will be resolved to an ISO code using a lookup dictionary
  • c when NULL or empty will make the search for that entry fall back to countryless

Existing Services

Level 0 administrative regions (Countries)

Data type

Polygons

Parameters
name type optional?
name text[] false
Current coverage

Global

Example requests

SELECT (geocode_admin0_polygons(Array['Spain', 'USA', ''])).*

See it on the api

See plpgsql

Level 1 administrative regions (States/Provinces)

Data type

Polygons

Parameters
name type optional?
name text[] false
country text[] true
countries text[] true
Current coverage

Global

Example requests

SELECT (geocode_admin1_polygons(Array['TX','Cuidad Real', 'sevilla'])).*
SELECT (geocode_admin1_polygons(Array['NH', 'Vermont'], 'United States')).*
SELECT (geocode_admin1_polygons(Array['az', 'az'], Array['Ecuador', 'USA'])).*

See it on the api

See plpgsql

Named Places

Data type

Points

Parameters
name type optional?
named_place text[] false
country_code string true
country_codes text[] true
Current coverage

Global

Example requests

SELECT (geocode_namedplace(Array['Madrid', 'New York City', 'sunapee'])).*
SELECT (geocode_namedplace(Array['sunapee', 'sunapeeee', 'New York City'], 'USA')).*
SELECT (geocode_namedplace(Array['sunapee', 'sunapeeee', 'New York City', 'Madrid'], Array['', 'US', 'United States', NULL])).*
SELECT (geocode_namedplace(
    Array['Portland', 'Portland', 'New York City'],
    Array['Maine',    'Oregon',    NULL],
    'USA')).*
SELECT (geocode_namedplace(
    Array['Portland', 'Portland', 'New York City'],
    Array['Maine','Oregon', null],
    NULL)).*

See it on the api

See plpgsql

IP Addresses

Data type

Points

Parameters
name type optional?
IP query array text[] false
Current coverage

Global

Example request

SELECT (geocode_ip(Array['1.0.16.0', '::ffff:1.0.16.0', 'not an IP'])).*

See it on the api

See plpgsql

Postal Code Polygons

Parameters
name type optional?
postal_code text[] false
country_code string true
country_codes text[] true
Current coverage

United States, Canada, Australia, France

Example requests

SELECT (geocode_postalcode_polygons(Array['10013','11201','03782'])).*
SELECT (geocode_postalcode_polygons(Array['10013','11201','03782'], 'USA')).*
SELECT (geocode_postalcode_polygons(Array['10013','G9H','03782'], Array['USA', 'Canada', 'US'])).*

See it on the api

See plpgsql

Postal Code Points

Parameters
name type optional?
postal_code text[] false
country_code string true
country_codes text[] true
Current coverage

Global see list

Example requests

SELECT (geocode_postalcode_points(Array['10013','11201','03782'])).*
SELECT (geocode_postalcode_points(Array['10013','11201','03782'], 'USA')).*
SELECT (geocode_postalcode_points(Array['10013','G9H','03782'], Array['USA', 'Canada', 'US'])).*

See it on the api

See plpgsql