Added schema to server functions and fixed some errors
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
-- Get values_json for provided key from conf table
|
-- Get values_json for provided key from conf table
|
||||||
CREATE OR REPLACE FUNCTION _get_conf(_key TEXT)
|
CREATE OR REPLACE FUNCTION cdb_geocoder_server._get_conf(_key TEXT)
|
||||||
RETURNS text
|
RETURNS text
|
||||||
AS $$
|
AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- Geocodes a street address given a searchtext and a state and/or country
|
-- Geocodes a street address given a searchtext and a state and/or country
|
||||||
CREATE OR REPLACE FUNCTION geocode_street(searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL)
|
CREATE OR REPLACE FUNCTION cdb_geocoder_server.geocode_street(searchtext TEXT, city TEXT DEFAULT NULL, state_province TEXT DEFAULT NULL, country TEXT DEFAULT NULL)
|
||||||
RETURNS Geometry
|
RETURNS Geometry
|
||||||
AS $$
|
AS $$
|
||||||
import json
|
import json
|
||||||
@@ -19,4 +19,4 @@ AS $$
|
|||||||
point = plpy.execute(plan, [coordinates[0], coordinates[1]], 1)[0]
|
point = plpy.execute(plan, [coordinates[0], coordinates[1]], 1)[0]
|
||||||
|
|
||||||
return point['st_setsrid']
|
return point['st_setsrid']
|
||||||
$$ LANGUAGE plpythonu;
|
$$ LANGUAGE plpythonu;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
-- Interface of the server extension
|
-- Interface of the server extension
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION geocode_admin0_polygons(user_id name, tx_id bigint, country_name text)
|
CREATE OR REPLACE FUNCTION cdb_geocoder_server.geocode_admin0_polygons(user_id name, tx_id bigint, country_name text)
|
||||||
RETURNS Geometry AS $$
|
RETURNS Geometry AS $$
|
||||||
plpy.debug('Entering geocode_admin0_polygons')
|
plpy.debug('Entering geocode_admin0_polygons')
|
||||||
plpy.debug('user_id = %s' % user_id)
|
plpy.debug('user_id = %s' % user_id)
|
||||||
@@ -26,7 +26,7 @@ $$ LANGUAGE plpythonu;
|
|||||||
|
|
||||||
-- Implementation of the server extension
|
-- Implementation of the server extension
|
||||||
-- Note: these functions depend on the cdb_geocoder extension
|
-- Note: these functions depend on the cdb_geocoder extension
|
||||||
CREATE OR REPLACE FUNCTION _geocode_admin0_polygons(country_name text)
|
CREATE OR REPLACE FUNCTION cdb_geocoder_server._geocode_admin0_polygons(country_name text)
|
||||||
RETURNS Geometry AS $$
|
RETURNS Geometry AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
ret Geometry;
|
ret Geometry;
|
||||||
|
|||||||
Reference in New Issue
Block a user