Fixes plural forms
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
-- Interfacess of the server extension
|
||||
|
||||
---- geocode_admin1_polygons(admin1_name text)
|
||||
CREATE OR REPLACE FUNCTION geocode_admin1_polygons(user_id name, tx_id bigint, admin1_name text)
|
||||
---- geocode_admin1_polygon(admin1_name text)
|
||||
CREATE OR REPLACE FUNCTION geocode_admin1_polygon(user_id name, tx_id bigint, admin1_name text)
|
||||
RETURNS Geometry AS $$
|
||||
plpy.debug('Entering geocode_admin1_polygons(admin1_name text)')
|
||||
plpy.debug('Entering geocode_admin1_polygon(admin1_name text)')
|
||||
plpy.debug('user_id = %s' % user_id)
|
||||
|
||||
#-- Access control
|
||||
@@ -15,17 +15,17 @@ RETURNS Geometry AS $$
|
||||
#--TODO: quota check
|
||||
|
||||
#-- Copied from the doc, see http://www.postgresql.org/docs/9.4/static/plpython-database.html
|
||||
plan = plpy.prepare("SELECT cdb_geocoder_server._geocode_admin1_polygons($1) AS mypolygon", ["text"])
|
||||
plan = plpy.prepare("SELECT cdb_geocoder_server._geocode_admin1_polygon($1) AS mypolygon", ["text"])
|
||||
rv = plpy.execute(plan, [admin1_name], 1)
|
||||
|
||||
plpy.debug('Returning from Returning from geocode_admin1_polygons')
|
||||
return rv[0]["mypolygon"]
|
||||
$$ LANGUAGE plpythonu;
|
||||
|
||||
---- geocode_admin1_polygons(admin1_name text, country_name text)
|
||||
CREATE OR REPLACE FUNCTION geocode_admin1_polygons(user_id name, tx_id bigint, admin1_name text, country_name text)
|
||||
---- geocode_admin1_polygon(admin1_name text, country_name text)
|
||||
CREATE OR REPLACE FUNCTION geocode_admin1_polygon(user_id name, tx_id bigint, admin1_name text, country_name text)
|
||||
RETURNS Geometry AS $$
|
||||
plpy.debug('Entering geocode_admin1_polygons(admin1_name text, country_name text)')
|
||||
plpy.debug('Entering geocode_admin1_polygon(admin1_name text, country_name text)')
|
||||
plpy.debug('user_id = %s' % user_id)
|
||||
|
||||
#-- Access control
|
||||
@@ -37,10 +37,10 @@ RETURNS Geometry AS $$
|
||||
#--TODO: quota check
|
||||
|
||||
#-- Copied from the doc, see http://www.postgresql.org/docs/9.4/static/plpython-database.html
|
||||
plan = plpy.prepare("SELECT cdb_geocoder_server._geocode_admin1_polygons($1, $2) AS mypolygon", ["text", "text"])
|
||||
plan = plpy.prepare("SELECT cdb_geocoder_server._geocode_admin1_polygon($1, $2) AS mypolygon", ["text", "text"])
|
||||
rv = plpy.execute(plan, [admin1_name, country_name], 1)
|
||||
|
||||
plpy.debug('Returning from Returning from geocode_admin1_polygons(admin1_name text, country_name text)')
|
||||
plpy.debug('Returning from Returning from geocode_admin1_polygon(admin1_name text, country_name text)')
|
||||
return rv[0]["mypolygon"]
|
||||
$$ LANGUAGE plpythonu;
|
||||
|
||||
@@ -49,8 +49,8 @@ $$ LANGUAGE plpythonu;
|
||||
-- Implementation of the server extension
|
||||
-- Note: these functions depend on the cdb_geocoder extension
|
||||
|
||||
---- geocode_admin1_polygons(admin1_name text)
|
||||
CREATE OR REPLACE FUNCTION _geocode_admin1_polygons(admin1_name text)
|
||||
---- geocode_admin1_polygon(admin1_name text)
|
||||
CREATE OR REPLACE FUNCTION _geocode_admin1_polygon(admin1_name text)
|
||||
RETURNS Geometry AS $$
|
||||
DECLARE
|
||||
ret Geometry;
|
||||
@@ -73,8 +73,8 @@ RETURNS Geometry AS $$
|
||||
END
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
---- geocode_admin1_polygons(admin1_name text, country_name text)
|
||||
CREATE OR REPLACE FUNCTION _geocode_admin1_polygons(admin1_name text, country_name text)
|
||||
---- geocode_admin1_polygon(admin1_name text, country_name text)
|
||||
CREATE OR REPLACE FUNCTION _geocode_admin1_polygon(admin1_name text, country_name text)
|
||||
RETURNS Geometry AS $$
|
||||
DECLARE
|
||||
ret Geometry;
|
||||
|
||||
Reference in New Issue
Block a user