From bf1afa51b632fb9e49da01944c05bfaa16b25302 Mon Sep 17 00:00:00 2001 From: Carla Date: Fri, 13 Nov 2015 16:20:13 +0100 Subject: [PATCH] Update API.md --- doc/API.md | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/doc/API.md b/doc/API.md index 3d2b293..414a52b 100644 --- a/doc/API.md +++ b/doc/API.md @@ -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. * **Return type:** `polygon` * **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 ###### geocode_admin1_polygon @@ -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`