Update API.md

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

View File

@ -48,10 +48,17 @@ 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.
* **Return type:** `polygon`
* **Usage example:**
SELECT
`````
SELECT geocode_admin0_polygon('France')
`````
UPDATE
`````
UPDATE {tablename} SET {the_geom} = geocode_admin0_polygon({country_column})
`````
#### Level-1 Administrative regions geocoder
###### geocode_admin1_polygon
* Functions:
@ -59,18 +66,32 @@ return type for the functions (Geometry or NULL if not found, with SRID 4326)
* **Parameters**:
* **Return type:** `polygon`
* **Usage example:**
SELECT
`````
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)`
* **Parameters**:
* **Return type:** `polygon`
* **Usage example:**
SELECT
`````
SELECT geocode_admin1_polygon('Alicante', 'Spain')
`````
UPDATE
`````
UPDATE {tablename} SET the_geom = geocode_admin1_polygon({province_column}, {country_column})
`````
#### City geocoder
##### geocode_namedplace_point
* Functions:
@ -78,18 +99,32 @@ return type for the functions (Geometry or NULL if not found, with SRID 4326)
* **Parameters**:
* **Return type:** `point`
* **Usage example:**
SELECT
`````
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)`
* **Parameters**:
* **Return type:** `point`
* **Usage example:**
SELECT
`````
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)`
* **Parameters**:
* **Return type:** `point`