From a1d6f79999ea3c4b34a3882a70876c6ff2baa79f Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Wed, 27 Jan 2016 17:53:17 +0100 Subject: [PATCH] Add the geocode street function doc --- doc/reference.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/doc/reference.md b/doc/reference.md index 59552be..01a6090 100644 --- a/doc/reference.md +++ b/doc/reference.md @@ -267,3 +267,44 @@ SELECT cdb_geocode_ipaddress_point('102.23.34.1') ```sql UPDATE {tablename} SET the_geom = cdb_geocode_ipaddress_point('102.23.34.1') ``` +## Street geocoder + +This function provides a street geocoding service. This service uses the street level geocoder defined for the user (right now only Heremaps geocoder is available). + +**This service is subject to quota limitations, and extra fees may apply. Please check our [terms and conditions](https://cartodb.com/terms/)** + +You should take into account the following advises about the use of this function: + - One credit per query will be charged, so you are therefore discouraged from using dynamic queries to the Geocoder API in your maps + - Dynamic queries in the maps may be forbidden in the futures. + - Store results of Geocoder API queries into your datasets and refresh them as needed, so that you can have finer control on your credits' usage. + +### cdb_geocode_street_point(_search_text text, [city text], [state text], [country text]_) + +#### Arguments + +Name | Type | Description +--- | --- | --- +`searchtext` | `text` | searchtext contains free-form text containing address elements. You can specify the searchtext parameter by itself, or you can specify it with other parameters to narrow your search. For example, you can specify the state or country parameters along with a free-form address in the searchtext field. +`city` | `text` | (Optional) Name of the city +`state` | `text` | (Optional) Name of the state +`country` | `text` | (Optional) Name of the country + +#### Returns + +Geometry (point, EPSG 4326) or null + +#### Example + +##### Select + +```sql +SELECT cdb_geocode_geocode_street_point('Lombard Street, San Francisco, California, United States') +SELECT cdb_geocode_geocode_street_point('Lombard Street' 'San Francisco') +SELECT cdb_geocode_geocode_street_point('Lombard Street' 'San Francisco', 'California') +SELECT cdb_geocode_geocode_street_point('Lombard Street' 'San Francisco', 'California', 'United States') +``` + +##### Update + +```sql +UPDATE {tablename} SET {the_geom} = cdb_geocode_street_point({street_name_column})