Update API.md

This commit is contained in:
Carla 2015-11-13 16:20:13 +01:00
parent b74c9f4311
commit bf1afa51b6

View File

@ -48,9 +48,16 @@ return type for the functions (Geometry or NULL if not found, with SRID 4326)
* **Parameters**: A text parameter with the name of the country to geocode. * **Parameters**: A text parameter with the name of the country to geocode.
* **Return type:** `polygon` * **Return type:** `polygon`
* **Usage example:** * **Usage example:**
SELECT
`````
SELECT geocode_admin0_polygon('France')
`````
UPDATE
`````
UPDATE {tablename} SET {the_geom} = geocode_admin0_polygon({country_column})
````` `````
SELECT geocode_admin0_polygon('France')
`````
#### Level-1 Administrative regions geocoder #### Level-1 Administrative regions geocoder
###### geocode_admin1_polygon ###### geocode_admin1_polygon
@ -59,18 +66,32 @@ return type for the functions (Geometry or NULL if not found, with SRID 4326)
* **Parameters**: * **Parameters**:
* **Return type:** `polygon` * **Return type:** `polygon`
* **Usage example:** * **Usage example:**
SELECT
````` `````
SELECT geocode_admin1_polygon('Alicante') SELECT geocode_admin1_polygon('Alicante')
````` `````
UPDATE
`````
UPDATE {tablename} SET the_geom = geocode_admin1_polygon({province_column})
`````
* `geocode_admin1_polygon(admin1_name text, country_name text)` * `geocode_admin1_polygon(admin1_name text, country_name text)`
* **Parameters**: * **Parameters**:
* **Return type:** `polygon` * **Return type:** `polygon`
* **Usage example:** * **Usage example:**
SELECT
````` `````
SELECT geocode_admin1_polygon('Alicante', 'Spain') SELECT geocode_admin1_polygon('Alicante', 'Spain')
````` `````
UPDATE
`````
UPDATE {tablename} SET the_geom = geocode_admin1_polygon({province_column}, {country_column})
`````
#### City geocoder #### City geocoder
##### geocode_namedplace_point ##### geocode_namedplace_point
* Functions: * Functions:
@ -78,18 +99,32 @@ return type for the functions (Geometry or NULL if not found, with SRID 4326)
* **Parameters**: * **Parameters**:
* **Return type:** `point` * **Return type:** `point`
* **Usage example:** * **Usage example:**
SELECT
````` `````
SELECT geocode_namedplace_point('Barcelona') SELECT geocode_namedplace_point('Barcelona')
````` `````
UPDATE
`````
UPDATE {tablename} SET the_geom = geocode_namedplace_point({city_column})
`````
* `geocode_namedplace_point(city_name text, country_name text)` * `geocode_namedplace_point(city_name text, country_name text)`
* **Parameters**: * **Parameters**:
* **Return type:** `point` * **Return type:** `point`
* **Usage example:** * **Usage example:**
SELECT
````` `````
SELECT geocode_namedplace_point('Barcelona', 'Spain') SELECT geocode_namedplace_point('Barcelona', 'Spain')
````` `````
UPDATE
`````
UPDATE {tablename} SET the_geom = geocode_namedplace_point({city_column}, 'Spain')
`````
* `geocode_namedplace_point(city_name text, admin1_name text, country_name text)` * `geocode_namedplace_point(city_name text, admin1_name text, country_name text)`
* **Parameters**: * **Parameters**:
* **Return type:** `point` * **Return type:** `point`